When an app is installed on a Wix site, the app may need to access and manage some of the site's data. To enable this, the site builder must grant the required permission scopes to the app when installing it. The app permissions are specific to the APIs that you use in your app.
Adding permissions is necessary in the following cases:
You do not need permissions in the following cases:
wix-widget
and wix-editor
modules.wix-dashboard
module.If your app requires permissions, but you didn't add them and so a site builder didn't provide consent, your code won't work. Everything might seem OK in Blocks - the release process won't fail. But once the app is installed on a site, the site will get a 403 screen instead of the app and the console will say that an API failed.
So you should be extremely cautions about permissions, especially if your app is already installed on users' sites. First, test your app on your own site, to see that your app works. Then release a major version for user sites.
Follow these steps to make sure you don't miss the required permissions. Each step is only needed if the first one wasn't successful.
In most cases, if an API requires permissions, you will see it in the Velo reference, under the Permissions
section.
For example, the bulkCreateBooking()
function requires the following permissions:
MANAGE BOOKINGS
MANAGE BOOKINGS - ALL PERMISSIONS
You can click the permission to add it to your app.
If you don't see permissions specified for your function in the API reference, take a look in the Velo legacy APIs permissions list.
If the API you are using has no permissions specified in the reference and it doesn't appear in the legacy list, you can assume that no permissions are needed.
You can add permissions in several ways: