> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetPermissions

# Package: collectionManagement

# Namespace: DataPermissionsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-permissions/get-permissions.md

## Permission Scopes:
Manage Data Collections: SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE

## Introduction

Retrieves the current permissions for the specified data collection.

---

## REST API

### Schema

```
 Method: getPermissions
 Description: Retrieves the current permissions for the specified data collection.
 URL: https://www.wixapis.com/wix-data/v1/permissions
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  dataCollectionId
 Method parameters: 
   query param name: dataCollectionId | type: dataCollectionId | description: GUID of the collection to retrieve permissions of. | required: true | validation: maxLength 256
 Return type: GetPermissionsResponse
  - name: dataPermissions | type: DataPermissions | description: Permissions of the specified collection.  
     - name: id | type: string | description: GUID of the collection for these permissions.  | validation: maxLength 255, immutable
     - name: itemRead | type: AccessLevel | description: Which users can read items from the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
         - enum:
         -     ANYONE: Anyone, including [site visitors](https://dev.wix.com/docs/rest/articles/get-started/about-identities.md#site-visitor).
         -     SITE_MEMBER: Logged-in [site members](https://dev.wix.com/docs/rest/articles/get-started/about-identities.md#site-member) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).
         -     SITE_MEMBER_AUTHOR: Logged-in [site members](https://dev.wix.com/docs/rest/articles/get-started/about-identities.md#site-member) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site) who can only access items they created.
         -     CMS_EDITOR: Site [collaborators with a CMS editor role](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps).
         -     PRIVILEGED: Site administrators, [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site), or roles with special permissions.  Learn more about [roles for site management](https://support.wix.com/en/article/roles-permissions-overview#general-roles-for-site-management).
     - name: itemInsert | type: AccessLevel | description: Which users can create new items in the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
     - name: itemUpdate | type: AccessLevel | description: Which users can update existing items in the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
     - name: itemRemove | type: AccessLevel | description: Which users can remove items from the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
     - name: specialPermissions | type: array<SpecialPermissions> | description: Special permissions granted to specified users or roles.  > **Note:** Special permissions override [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions).  | read-only: true | validation: maxItems 1000
        - ONE-OF: 
           - name: userId | type: string | description: GUID of the user for these special permissions.  | validation: maxLength 64, immutable
           - name: policyId | type: string | description: GUID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#user-roles) for these special permissions.  To find the GUID of a role, call [Get Roles Info](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info.md). Roles and their GUIDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.  Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).  | validation: maxLength 64, immutable
        - name: id | type: string | description: GUID of the special permissions set.  | read-only: true | validation: format GUID
        - name: itemRead | type: Access | description: Whether the specified users or roles can read items from the collection.  When set to `ALLOWED`, users can read items from the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
             - enum:
             -     UNSPECIFIED: No special permissions. [Collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply to this action.
             -     ALLOWED: User or role has special permissions to perform this action, overriding [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions).
        - name: itemInsert | type: Access | description: Whether the specified users or roles can create new items in the collection.  When set to `ALLOWED`, users can create new items in the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
        - name: itemUpdate | type: Access | description: Whether the specified users or roles can update existing items in the collection.  When set to `ALLOWED`, users can update existing items in the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
        - name: itemRemove | type: Access | description: Whether the specified users or roles can remove items from the collection.  When set to `ALLOWED`, users can remove items from the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0025 | Description: Returned when the specified data collection isn't found.  Learn more about [Wix Data error codes](https://dev.wix.com/docs/rest/business-solutions/cms/wix-data-error-codes.md).


```

### Examples

### Get data collection permissions
```curl
curl -X GET 'https://www.wixapis.com/wix-data/v1/permissions?data_collection_id=my-first-collection' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.data.permissions.getPermissions(dataCollectionId)
 Description: Retrieves the current permissions for the specified data collection.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  dataCollectionId
 Method parameters: 
   param name: dataCollectionId | type: string | description: GUID of the collection to retrieve permissions of. | required: true | validation: maxLength 256
 Return type: PROMISE<GetPermissionsResponse>
  - name: dataPermissions | type: DataPermissions | description: Permissions of the specified collection.  
     - name: _id | type: string | description: GUID of the collection for these permissions.  | validation: maxLength 255, immutable
     - name: itemRead | type: AccessLevel | description: Which users can read items from the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
         - enum:
         -     ANYONE: Anyone, including [site visitors](https://dev.wix.com/docs/rest/articles/get-started/about-identities.md#site-visitor).
         -     SITE_MEMBER: Logged-in [site members](https://dev.wix.com/docs/rest/articles/get-started/about-identities.md#site-member) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).
         -     SITE_MEMBER_AUTHOR: Logged-in [site members](https://dev.wix.com/docs/rest/articles/get-started/about-identities.md#site-member) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site) who can only access items they created.
         -     CMS_EDITOR: Site [collaborators with a CMS editor role](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps).
         -     PRIVILEGED: Site administrators, [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site), or roles with special permissions.  Learn more about [roles for site management](https://support.wix.com/en/article/roles-permissions-overview#general-roles-for-site-management).
     - name: itemInsert | type: AccessLevel | description: Which users can create new items in the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
     - name: itemUpdate | type: AccessLevel | description: Which users can update existing items in the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
     - name: itemRemove | type: AccessLevel | description: Which users can remove items from the collection.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
     - name: specialPermissions | type: array<SpecialPermissions> | description: Special permissions granted to specified users or roles.  > **Note:** Special permissions override [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions).  | read-only: true | validation: maxItems 1000
        - ONE-OF: 
           - name: userId | type: string | description: GUID of the user for these special permissions.  | validation: maxLength 64, immutable
           - name: policyId | type: string | description: GUID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#user-roles) for these special permissions.  To find the GUID of a role, call [Get Roles Info](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info.md). Roles and their GUIDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.  Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).  | validation: maxLength 64, immutable
        - name: _id | type: string | description: GUID of the special permissions set.  | read-only: true | validation: format GUID
        - name: itemRead | type: Access | description: Whether the specified users or roles can read items from the collection.  When set to `ALLOWED`, users can read items from the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
             - enum:
             -     UNSPECIFIED: No special permissions. [Collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply to this action.
             -     ALLOWED: User or role has special permissions to perform this action, overriding [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions).
        - name: itemInsert | type: Access | description: Whether the specified users or roles can create new items in the collection.  When set to `ALLOWED`, users can create new items in the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
        - name: itemUpdate | type: Access | description: Whether the specified users or roles can update existing items in the collection.  When set to `ALLOWED`, users can update existing items in the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  
        - name: itemRemove | type: Access | description: Whether the specified users or roles can remove items from the collection.  When set to `ALLOWED`, users can remove items from the collection. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#collection-level-permissions) apply.  Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction.md#item-actions).  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0025 | Description: Returned when the specified data collection isn't found.  Learn more about [Wix Data error codes](https://dev.wix.com/docs/rest/business-solutions/cms/wix-data-error-codes.md).


```

### Examples

### getPermissions
```javascript
import { permissions } from '@wix/data';

async function getPermissions(dataCollectionId) {
  const response = await permissions.getPermissions(dataCollectionId);
};
```

### getPermissions (with elevated permissions)
```javascript
import { permissions } from '@wix/data';
import { auth } from '@wix/essentials';

async function myGetPermissionsMethod(dataCollectionId) {
  const elevatedGetPermissions = auth.elevate(permissions.getPermissions);
  const response = await elevatedGetPermissions(dataCollectionId);
}
```

### getPermissions (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { permissions } from '@wix/data';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { permissions },
  // Include the auth strategy and host as relevant
});


async function getPermissions(dataCollectionId) {
  const response = await myWixClient.permissions.getPermissions(dataCollectionId);
};
```

---