Data Permissions: Sample Use Cases and Flows

This article presents possible use cases and corresponding sample flows that you can support. These flows provide helpful starting points as you plan your implementation.

Set up member-only access for a collection

Configure a collection's permissions so that only site members can view its items, and only CMS editors can make changes.

To set up member-only access for a collection:

  1. Call Update Permissions and specify the following parameters:

    Copy

    The method returns a response such as:

    Copy
  2. To check the updated permissions, call Get Permissions with the collection ID.

    The method returns a response such as:

    Copy

Add special permissions to a custom user role

Configure a collection's permissions so that all site members can edit the items they created, and only users with a specified role can edit all items.

  1. Call Update Permissions to allow site members to only edit the items they created:

    Copy

    The method returns a response such as:

    Copy
  2. To add special edit permissions to a user role, retrieve the role ID by calling Get Roles Info. You can find the roles and their IDs in the predefinedRoles or the customRoles arrays in the method response:

    Copy

    Learn more about creating custom roles and permissions in the CMS.

  3. Call Add Special Permissions to allow all users with the custom role to edit all items in the collection. Specify the role ID from the previous step:

    Copy

    The method returns a response such as:

    Copy
  4. To check the updated permissions, call Get Permissions with the collection ID.

    The method returns a response such as:

    Copy

Note: When you set up special permissions for a particular action to UNSPECIFIED, the collection's default access level applies for that action.

This allows you to specify certain permission overrides while maintaining collection-level permissions for actions whose role requirements you don't want to change.

Did this help?