Note for app developers: Wix Data APIs require the site's code editor to be enabled. If you are building a Wix app, add a data collections extension to automatically enable the code editor and create data collections when your app is installed on a site.
The Data Permissions API manages access control for data collections, allowing you to determine who can perform actions on collection items. You can set collection-level permissions for each action, or grant special permissions to specific Wix users or roles.
With the Data Permissions API, you can:
Learn more about collection permissions.
The Data Permissions API lets you manage 2 types of permissions:
Every data collection has a default set of permissions that specify the minimum user role required to perform an action on a collection item. To perform an action, the user must have the specified role or higher.
You can add special permissions to specific users or roles that override collection-level permissions. Special permissions allow Wix users or roles to perform actions on collection items that they otherwise can't perform.
Note: When you remove special permissions from a Wix user or role, collection-level permissions apply instead.
User roles serve as access levels that define which actions users can perform on collection items. Roles are hierarchical, so users with a particular role can also perform actions that require lower-access roles.
The following roles are listed by their access level in descending order:
PRIVILEGED: Only site administrators and users with special permissions can perform the action.SITE_MEMBER_AUTHOR: Wix users must be logged-in members to perform the action, but they can only access items that they created.SITE_MEMBER: Wix users must be logged in to perform the action. This role includes site members and collaborators.ANYONE: Any site visitor can perform the action, including site visitors.For example, users who can perform actions restricted to a CMS_EDITOR role can also perform actions that require the SITE_MEMBER_AUTHOR, SITE_MEMBER, ANYONE roles.
You can allow or restrict Wix users from performing the following actions on collection items:
It's important to note the following before starting to code: