Skip to main content

PermissionDefinition

Defines a new Permission with which to control access to GraphQL resolvers & REST controllers. Used in conjunction with the Allow decorator (see example below).

Note: To define CRUD permissions, use the CrudPermissionDefinition.

Example

Ts
Ts
Ts
Signature

constructor

method(config: PermissionDefinitionConfig) => PermissionDefinition

Permission

propertyPermission

Returns the permission defined by this definition, for use in the Allow decorator.

Defines a set of CRUD Permissions for the given name, i.e. a name of 'Wishlist' will create 4 Permissions: 'CreateWishlist', 'ReadWishlist', 'UpdateWishlist' & 'DeleteWishlist'.

Example

Ts
Ts
Ts
Signature

constructor

method(name: string, descriptionFn?: (operation: 'create' | 'read' | 'update' | 'delete') => string) => CrudPermissionDefinition

Create

propertyPermission

Returns the 'Create' CRUD permission defined by this definition, for use in the Allow decorator.

Read

propertyPermission

Returns the 'Read' CRUD permission defined by this definition, for use in the Allow decorator.

Update

propertyPermission

Returns the 'Update' CRUD permission defined by this definition, for use in the Allow decorator.

Delete

propertyPermission

Returns the 'Delete' CRUD permission defined by this definition, for use in the Allow decorator.

Defines a set of Read-Write Permissions for the given name, i.e. a name of 'DashboardSavedViews' will create 2 Permissions: 'ReadDashboardSavedViews' and 'WriteDashboardSavedViews'.

Example

Ts
Ts
Ts
Signature

constructor

method(name: string, descriptionFn?: (operation: 'read' | 'write') => string) => RwPermissionDefinition

Read

propertyPermission

Returns the 'Read' permission defined by this definition, for use in the Allow decorator.

Write

propertyPermission

Returns the 'Write' permission defined by this definition, for use in the Allow decorator.

Configures a PermissionDefinition

Signature

name

propertystring

The name of the permission. By convention this should be UpperCamelCased.

description

propertystring

A description of the permission.

assignable

propertyboolean
Default:true

Whether this permission can be assigned to a Role. In general this should be left as the default true except in special cases.

internal

propertyboolean
Default:false

Internal permissions are not exposed via the API and are reserved for special use-cases such at the Owner or Public permissions.

Was this chapter helpful?
Report Issue
Edited Feb 10, 2026ยทEdit this page