import { NonNullablePaths } from '@wix/sdk-types'; /** * Permissions that determine who can access or perform actions on items in a data collection. * * Learn more about [collection permissions](https://support.wix.com/en/article/cms-collection-permissions-overview). */ interface DataPermissions { /** * ID of the collection for these permissions. * @immutable * @maxLength 255 */ _id?: string; /** * 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#item-actions). */ itemRead?: AccessLevelWithLiterals; /** * 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#item-actions). */ itemInsert?: AccessLevelWithLiterals; /** * 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#item-actions). */ itemUpdate?: AccessLevelWithLiterals; /** * 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#item-actions). */ itemRemove?: AccessLevelWithLiterals; /** * 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#collection-level-permissions). * @readonly * @maxSize 1000 */ specialPermissions?: SpecialPermissions[]; /** * Permissions for managing drafts and publish status in the collection. * * Present only when the collection has the draft items plugin. * @internal */ draftItemsPluginPermissions?: DraftItemsPluginPermissions; } /** Minimal access level required to perform an action on collection items. Each access level includes the permissions of the access levels below it. */ declare enum AccessLevel { /** Anyone, including [site visitors](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-visitor). */ ANYONE = "ANYONE", /** Logged-in [site members](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */ SITE_MEMBER = "SITE_MEMBER", /** Logged-in [site members](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site) who can only access items they created. */ SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR", /** Site [collaborators with a CMS editor role](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps). */ CMS_EDITOR = "CMS_EDITOR", /** * 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). */ PRIVILEGED = "PRIVILEGED" } /** @enumType */ type AccessLevelWithLiterals = AccessLevel | 'ANYONE' | 'SITE_MEMBER' | 'SITE_MEMBER_AUTHOR' | 'CMS_EDITOR' | 'PRIVILEGED'; interface SpecialPermissions extends SpecialPermissionsSubjectOneOf { /** * ID of the user for these special permissions. * @immutable * @maxLength 64 */ userId?: string; /** * ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) for these special permissions. * * To find the ID of a role, call [Get Roles Info](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info). Roles and their IDs 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). * @immutable * @maxLength 64 */ policyId?: string; /** * ID of the special permissions set. * @format GUID * @readonly */ _id?: string; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemRead?: AccessWithLiterals; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemInsert?: AccessWithLiterals; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemUpdate?: AccessWithLiterals; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemRemove?: AccessWithLiterals; /** * Whether the specified users or roles can manage drafts and publish/unpublish data items in the collection. * When set to `ALLOWED`, users can manage drafts and publish/unpublish data items. * @internal */ draftItemsPluginPermissions?: SpecialPermissionsDraftItemsPluginPermissions; } /** @oneof */ interface SpecialPermissionsSubjectOneOf { /** * ID of the user for these special permissions. * @immutable * @maxLength 64 */ userId?: string; /** * ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) for these special permissions. * * To find the ID of a role, call [Get Roles Info](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info). Roles and their IDs 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). * @immutable * @maxLength 64 */ policyId?: string; } declare enum Access { /** No special permissions. [Collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions) apply to this action. */ UNSPECIFIED = "UNSPECIFIED", /** 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#collection-level-permissions). */ ALLOWED = "ALLOWED" } /** @enumType */ type AccessWithLiterals = Access | 'UNSPECIFIED' | 'ALLOWED'; interface SpecialPermissionsDraftItemsPluginPermissions { /** Whether the specified users or roles can manage drafts in the collection. When set to `ALLOWED`, users can manage drafts. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions) apply. */ manageDrafts?: AccessWithLiterals; /** Whether the specified users or roles can manage publish status in the collection. When set to `ALLOWED`, users can manage publish status. When set to `UNSPECIFIED`, [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions) apply. */ managePublishStatus?: AccessWithLiterals; } /** Collection-level permissions contributed by the draft items plugin. */ interface DraftItemsPluginPermissions { /** Access level required to manage drafts (view, edit, and remove draft items) in the collection. */ manageDrafts?: AccessLevelWithLiterals; /** Access level required to publish draft items and unpublish published items in the collection. */ managePublishStatus?: AccessLevelWithLiterals; } interface GetPermissionsRequest { /** * ID of the collection to retrieve permissions of. * @maxLength 256 */ dataCollectionId: string; } interface GetPermissionsResponse { /** Permissions of the specified collection. */ dataPermissions?: DataPermissions; } interface UpdatePermissionsRequest { /** Permissions to update. */ dataPermissions: DataPermissions; } interface UpdatePermissionsResponse { /** Updated permissions of the specified collection. */ dataPermissions?: DataPermissions; } interface AddSpecialPermissionsRequest { /** * ID of the collection for which to grant special permissions. * @maxLength 256 */ dataCollectionId: string; /** Special permissions to grant to the user or role for the specified collection. */ specialPermissions: SpecialPermissions; } interface AddSpecialPermissionsResponse { /** Special permissions granted to the user or role for the specified collection. */ specialPermissions?: SpecialPermissions; } interface UpdateSpecialPermissionsRequest { /** Special permissions to update for the specified user or role. */ specialPermissions: SpecialPermissions; } interface UpdateSpecialPermissionsResponse { /** Special permissions updated for the specified user or role. */ specialPermissions?: SpecialPermissions; } interface RemoveSpecialPermissionsRequest { /** * ID of the special permissions to remove. * @format GUID */ specialPermissionsId: string; } interface RemoveSpecialPermissionsResponse { } interface GetMyPermissionsRequest { /** * ID of the collection for which to check the current user's permissions. * @maxLength 256 */ dataCollectionId: string; } interface GetMyPermissionsResponse { /** Whether the current user can read items from the collection. */ itemRead?: boolean; /** Whether the current user can create new items in the collection. */ itemInsert?: boolean; /** Whether the current user can update existing items in the collection. */ itemUpdate?: boolean; /** Whether the current user can remove items from the collection. */ itemRemove?: boolean; /** * Draft management operations the current user can perform in the collection. * * Present only when the collection has the draft items plugin. * @internal */ draftItemsPluginPermissions?: GetMyPermissionsResponseDraftItemsPluginPermissions; } /** Draft management operations the current user is allowed to perform, contributed by the draft items plugin. */ interface GetMyPermissionsResponseDraftItemsPluginPermissions { /** Whether the current user can manage drafts (view, edit, and remove draft items) in the collection. */ manageDrafts?: boolean; /** Whether the current user can manage publish status (publish and unpublish items) in the collection. */ managePublishStatus?: boolean; } interface MigrateCustomRolesRequest { /** * ID of the role to update. If empty, all roles in the site are updated. * @format GUID */ policyId?: string | null; } interface MigrateCustomRolesResponse { } interface PolicyAssignmentsUpdated extends PolicyAssignmentsUpdatedEventOneOf { policyAssigned?: PolicyAssigned; policyUnassigned?: PolicyUnassigned; policyAssignmentUpdated?: PolicyAssignmentUpdated; } /** @oneof */ interface PolicyAssignmentsUpdatedEventOneOf { policyAssigned?: PolicyAssigned; policyUnassigned?: PolicyUnassigned; policyAssignmentUpdated?: PolicyAssignmentUpdated; } interface PolicyAssigned { subject?: Subject; assignment?: PolicyAssignment[]; } interface Subject { /** ID of identity assigned to the asset. */ _id?: string; /** Type of identity assigned to the asset. Supported subject types include user IDs, account IDs, and app IDs. */ subjectType?: SubjectTypeWithLiterals; /** Context of identity assigned to the asset. For example, a `subjectType` = `USER` will have `context` = `ACCOUNT`. */ context?: SubjectContext; } declare enum SubjectType { UNKNOWN = "UNKNOWN", ACCOUNT = "ACCOUNT", USER = "USER", USER_GROUP = "USER_GROUP", MEMBER_GROUP = "MEMBER_GROUP", VISITOR_GROUP = "VISITOR_GROUP", EXTERNAL_APP = "EXTERNAL_APP", ACCOUNT_GROUP = "ACCOUNT_GROUP", WIX_APP = "WIX_APP" } /** @enumType */ type SubjectTypeWithLiterals = SubjectType | 'UNKNOWN' | 'ACCOUNT' | 'USER' | 'USER_GROUP' | 'MEMBER_GROUP' | 'VISITOR_GROUP' | 'EXTERNAL_APP' | 'ACCOUNT_GROUP' | 'WIX_APP'; interface SubjectContext { _id?: string; contextType?: SubjectContextTypeWithLiterals; } declare enum SubjectContextType { UNKNOWN_CTX = "UNKNOWN_CTX", ORG_CTX = "ORG_CTX", ACCOUNT_CTX = "ACCOUNT_CTX" } /** @enumType */ type SubjectContextTypeWithLiterals = SubjectContextType | 'UNKNOWN_CTX' | 'ORG_CTX' | 'ACCOUNT_CTX'; interface PolicyAssignment { policyId?: string; resource?: ResourcePath; condition?: PolicyCondition; assignmentId?: string | null; } interface ResourcePath { organization?: string | null; account?: string | null; site?: string | null; resource?: Resource; } /** * A custom resource. Is used to represent some asset that is not a direct resource context (site or account), but something custom. * For example: payment method, blog post, domain, logo. */ interface Resource { /** The resource id. */ _id?: string | null; /** The resource type */ type?: string | null; } interface PolicyCondition { /** The type of the condition */ condition?: ConditionType; } interface ConditionType extends ConditionTypeOfOneOf { /** @deprecated */ simpleCondition?: SimpleCondition; /** A logic combination between several conditions, with an operator between them */ joinedConditions?: JoinedCondition; /** @deprecated */ environmentCondition?: EnvironmentCondition; /** A single condition */ condition?: Condition; } /** @oneof */ interface ConditionTypeOfOneOf { /** @deprecated */ simpleCondition?: SimpleCondition; /** A logic combination between several conditions, with an operator between them */ joinedConditions?: JoinedCondition; /** @deprecated */ environmentCondition?: EnvironmentCondition; /** A single condition */ condition?: Condition; } interface SimpleCondition { attrName?: string; value?: SimpleConditionValue; op?: SimpleConditionOperatorWithLiterals; conditionModelId?: string; } interface SimpleConditionValue extends SimpleConditionValueValueOneOf { attrName?: string; stringValue?: string; boolValue?: boolean; } /** @oneof */ interface SimpleConditionValueValueOneOf { attrName?: string; stringValue?: string; boolValue?: boolean; } declare enum SimpleConditionOperator { UNKNOWN_SIMPLE_OP = "UNKNOWN_SIMPLE_OP", EQUAL = "EQUAL" } /** @enumType */ type SimpleConditionOperatorWithLiterals = SimpleConditionOperator | 'UNKNOWN_SIMPLE_OP' | 'EQUAL'; interface JoinedCondition { /** The operator that should be used when evaluating the condition */ op?: JoinedConditionOperatorWithLiterals; /** The conditions that should be evaluated, and then joined using the operator provided */ conditions?: ConditionType[]; } declare enum JoinedConditionOperator { UNKNOWN_JOIN_OP = "UNKNOWN_JOIN_OP", OR = "OR", AND = "AND" } /** @enumType */ type JoinedConditionOperatorWithLiterals = JoinedConditionOperator | 'UNKNOWN_JOIN_OP' | 'OR' | 'AND'; interface EnvironmentCondition extends EnvironmentConditionConditionOneOf { experimentCondition?: ExperimentCondition; } /** @oneof */ interface EnvironmentConditionConditionOneOf { experimentCondition?: ExperimentCondition; } interface ExperimentCondition { spec?: string; fallbackValue?: string; expectedValue?: string; } interface Condition { /** The unique identifier of the condition model. Indicates which actions the condition is working on */ conditionModelId?: string; /** The operator that should be evaluated */ operator?: ConditionOperator; } interface ConditionOperator extends ConditionOperatorOperatorsOneOf { /** Comparison of equality - will be evaluated to true if the given parties are equal */ equals?: EqualOperator; /** Regex operator - will be evaluated to true if the given value matches the provided regex */ like?: LikeOperator; /** Petri experiment - will be evaluated using petri. */ experiment?: ExperimentOperator; /** Operator that indicates a dependency on another subject being allowed to perform something. */ dependOn?: DependOnOperator; } /** @oneof */ interface ConditionOperatorOperatorsOneOf { /** Comparison of equality - will be evaluated to true if the given parties are equal */ equals?: EqualOperator; /** Regex operator - will be evaluated to true if the given value matches the provided regex */ like?: LikeOperator; /** Petri experiment - will be evaluated using petri. */ experiment?: ExperimentOperator; /** Operator that indicates a dependency on another subject being allowed to perform something. */ dependOn?: DependOnOperator; } interface EqualOperator { /** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the other side (attribute/value) */ attrName?: string; /** The value to compare to. If the two parties are equal - we will return true. */ value?: ConditionValue; } interface ConditionValue extends ConditionValueValueOneOf { /** an attribute. We'll first retrieve the value of the attribute (from the request or from pre-indexed values), and then compare to what it needs to be compared with. */ attrName?: string; /** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */ stringValue?: string; /** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */ boolValue?: boolean; } /** @oneof */ interface ConditionValueValueOneOf { /** an attribute. We'll first retrieve the value of the attribute (from the request or from pre-indexed values), and then compare to what it needs to be compared with. */ attrName?: string; /** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */ stringValue?: string; /** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */ boolValue?: boolean; } interface LikeOperator { /** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the regex values provided. */ attrName?: string; /** The regex values which the attribute value should be evaluated on. If the attribute value matches at least one of the regular expressions provided - we will return true */ values?: string[]; } interface ExperimentOperator { /** The spec to conduct the experiment on. */ spec?: string; /** The value to use if the experiment could not be conducted */ fallbackValue?: string; /** The expected value of the experiment conduction. If it matches the actual value - true will be returned. Otherwise - false. */ expectedValue?: string; } /** Implies that the policy takes affect only if the depend on subject is permitted as well. */ interface DependOnOperator { /** The subject on which the current entry depends on. If the subject is allowed to perform what the query was about - the condition will be evaluated to true. Otherwise - false */ dependOnSubject?: Subject; } interface PolicyUnassigned { subject?: Subject; assignment?: PolicyAssignment[]; } interface PolicyAssignmentUpdated { subject?: Subject; fromAssignment?: PolicyAssignment[]; toAssignment?: PolicyAssignment[]; } interface Empty { } interface PolicyAuthorizationDataUpdated { policyId?: string; fromPolicyStatements?: PolicyStatement[]; toPolicyStatements?: PolicyStatement[]; policyType?: PolicyTypeWithLiterals; policyOwner?: PolicyOwner; } interface PolicyStatement { /** @readonly */ _id?: string | null; permissions?: string[]; scopes?: string[]; effect?: EffectWithLiterals; condition?: PolicyCondition; } declare enum Effect { UNKNOWN_EFFECT = "UNKNOWN_EFFECT", ALLOW = "ALLOW", DENY = "DENY" } /** @enumType */ type EffectWithLiterals = Effect | 'UNKNOWN_EFFECT' | 'ALLOW' | 'DENY'; declare enum PolicyType { UNKNOWN_STATUS = "UNKNOWN_STATUS", PREDEFINED = "PREDEFINED", CUSTOM = "CUSTOM", INLINE_CUSTOM = "INLINE_CUSTOM" } /** @enumType */ type PolicyTypeWithLiterals = PolicyType | 'UNKNOWN_STATUS' | 'PREDEFINED' | 'CUSTOM' | 'INLINE_CUSTOM'; interface PolicyOwner { type?: PolicyOwnerTypeWithLiterals; _id?: string; } declare enum PolicyOwnerType { UNKNOWN_TYPE = "UNKNOWN_TYPE", WIX = "WIX", WIX_ACCOUNT = "WIX_ACCOUNT" } /** @enumType */ type PolicyOwnerTypeWithLiterals = PolicyOwnerType | 'UNKNOWN_TYPE' | 'WIX' | 'WIX_ACCOUNT'; interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } /** @docsIgnore */ type GetPermissionsApplicationErrors = { code?: 'WDE0025'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdatePermissionsApplicationErrors = { code?: 'WDE0025'; description?: string; data?: Record; }; /** @docsIgnore */ type AddSpecialPermissionsApplicationErrors = { code?: 'ALREADY_EXISTS'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdateSpecialPermissionsApplicationErrors = { code?: 'NOT_FOUND'; description?: string; data?: Record; }; /** @docsIgnore */ type RemoveSpecialPermissionsApplicationErrors = { code?: 'NOT_FOUND'; description?: string; data?: Record; }; /** @docsIgnore */ type GetMyPermissionsApplicationErrors = { code?: 'WDE0025'; description?: string; data?: Record; }; /** * Retrieves the current permissions for the specified data collection. * @param dataCollectionId - ID of the collection to retrieve permissions of. * @public * @requiredField dataCollectionId * @permissionId WIX_DATA.PERMISSIONS_READ * @applicableIdentity APP * @fqn wix.cloud.permissions.v1.DataPermissionsService.GetPermissions */ declare function getPermissions(dataCollectionId: string): Promise & { __applicationErrorsType?: GetPermissionsApplicationErrors; }>; /** * Updates permissions for the specified data collection. * * > **Note:** To update special permissions, call [Update Special Permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions). * @param dataPermissions - Permissions to update. * @public * @requiredField dataPermissions * @requiredField dataPermissions._id * @requiredField dataPermissions.itemInsert * @requiredField dataPermissions.itemRead * @requiredField dataPermissions.itemRemove * @requiredField dataPermissions.itemUpdate * @permissionId WIX_DATA.PERMISSIONS_UPDATE * @applicableIdentity APP * @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdatePermissions */ declare function updatePermissions(dataPermissions: NonNullablePaths): Promise & { __applicationErrorsType?: UpdatePermissionsApplicationErrors; }>; /** * Adds special permissions to a specific user or role for the specified data collection. * * Special permissions allow specific users or roles to perform actions that [collection-level permissions](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-permissions/introduction#collection-level-permissions) restrict. * @param dataCollectionId - ID of the collection for which to grant special permissions. * @param specialPermissions - Special permissions to grant to the user or role for the specified collection. * @public * @requiredField dataCollectionId * @requiredField specialPermissions * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL * @applicableIdentity APP * @fqn wix.cloud.permissions.v1.DataPermissionsService.AddSpecialPermissions */ declare function addSpecialPermissions(dataCollectionId: string, specialPermissions: SpecialPermissions): Promise & { __applicationErrorsType?: AddSpecialPermissionsApplicationErrors; }>; /** * Updates the special permissions for the specified user or role. * * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and replaced by [collection-level permissions](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-permissions/introduction#collection-level-permissions). * @param _id - ID of the special permissions set. * @public * @requiredField _id * @requiredField specialPermissions * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL * @applicableIdentity APP * @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdateSpecialPermissions */ declare function updateSpecialPermissions(_id: string, specialPermissions: UpdateSpecialPermissions): Promise & { __applicationErrorsType?: UpdateSpecialPermissionsApplicationErrors; }>; interface UpdateSpecialPermissions { /** * ID of the user for these special permissions. * @immutable * @maxLength 64 */ userId?: string; /** * ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) for these special permissions. * * To find the ID of a role, call [Get Roles Info](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info). Roles and their IDs 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). * @immutable * @maxLength 64 */ policyId?: string; /** * ID of the special permissions set. * @format GUID * @readonly */ _id?: string; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemRead?: AccessWithLiterals; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemInsert?: AccessWithLiterals; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemUpdate?: AccessWithLiterals; /** * 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#collection-level-permissions) apply. * * Learn more about [item actions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#item-actions). */ itemRemove?: AccessWithLiterals; /** * Whether the specified users or roles can manage drafts and publish/unpublish data items in the collection. * When set to `ALLOWED`, users can manage drafts and publish/unpublish data items. * @internal */ draftItemsPluginPermissions?: SpecialPermissionsDraftItemsPluginPermissions; } /** * Removes special permissions from a specific user or role. * * When you remove special permissions, [collection-level permissions](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-permissions/introduction#collection-level-permissions) apply to the user or role for all actions. * @param specialPermissionsId - ID of the special permissions to remove. * @public * @requiredField specialPermissionsId * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL * @applicableIdentity APP * @fqn wix.cloud.permissions.v1.DataPermissionsService.RemoveSpecialPermissions */ declare function removeSpecialPermissions(specialPermissionsId: string): Promise; /** * Retrieves the current user's permissions for the specified data collection. * @param dataCollectionId - ID of the collection for which to check the current user's permissions. * @public * @requiredField dataCollectionId * @permissionId WIX_DATA.PERMISSIONS_GET_ALLOWED * @applicableIdentity APP * @fqn wix.cloud.permissions.v1.DataPermissionsService.GetMyPermissions */ declare function getMyPermissions(dataCollectionId: string): Promise & { __applicationErrorsType?: GetMyPermissionsApplicationErrors; }>; export { Access, AccessLevel, type AccessLevelWithLiterals, type AccessWithLiterals, type ActionEvent, type AddSpecialPermissionsApplicationErrors, type AddSpecialPermissionsRequest, type AddSpecialPermissionsResponse, type Condition, type ConditionOperator, type ConditionOperatorOperatorsOneOf, type ConditionType, type ConditionTypeOfOneOf, type ConditionValue, type ConditionValueValueOneOf, type DataPermissions, type DependOnOperator, type DomainEvent, type DomainEventBodyOneOf, type DraftItemsPluginPermissions, Effect, type EffectWithLiterals, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EnvironmentCondition, type EnvironmentConditionConditionOneOf, type EqualOperator, type ExperimentCondition, type ExperimentOperator, type GetMyPermissionsApplicationErrors, type GetMyPermissionsRequest, type GetMyPermissionsResponse, type GetMyPermissionsResponseDraftItemsPluginPermissions, type GetPermissionsApplicationErrors, type GetPermissionsRequest, type GetPermissionsResponse, type JoinedCondition, JoinedConditionOperator, type JoinedConditionOperatorWithLiterals, type LikeOperator, type MigrateCustomRolesRequest, type MigrateCustomRolesResponse, type PolicyAssigned, type PolicyAssignment, type PolicyAssignmentUpdated, type PolicyAssignmentsUpdated, type PolicyAssignmentsUpdatedEventOneOf, type PolicyAuthorizationDataUpdated, type PolicyCondition, type PolicyOwner, PolicyOwnerType, type PolicyOwnerTypeWithLiterals, type PolicyStatement, PolicyType, type PolicyTypeWithLiterals, type PolicyUnassigned, type RemoveSpecialPermissionsApplicationErrors, type RemoveSpecialPermissionsRequest, type RemoveSpecialPermissionsResponse, type Resource, type ResourcePath, type RestoreInfo, type SimpleCondition, SimpleConditionOperator, type SimpleConditionOperatorWithLiterals, type SimpleConditionValue, type SimpleConditionValueValueOneOf, type SpecialPermissions, type SpecialPermissionsDraftItemsPluginPermissions, type SpecialPermissionsSubjectOneOf, type Subject, type SubjectContext, SubjectContextType, type SubjectContextTypeWithLiterals, SubjectType, type SubjectTypeWithLiterals, type UpdatePermissionsApplicationErrors, type UpdatePermissionsRequest, type UpdatePermissionsResponse, type UpdateSpecialPermissions, type UpdateSpecialPermissionsApplicationErrors, type UpdateSpecialPermissionsRequest, type UpdateSpecialPermissionsResponse, addSpecialPermissions, getMyPermissions, getPermissions, removeSpecialPermissions, updatePermissions, updateSpecialPermissions };