- Home [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
-
Getting started
- Manage types
- Global context and isolation
- Manage apps
- Batch actions with app items
- Manage external services
- Scripts in widgets
- Web components
- Access permissions
- Getting started with processes
- Getting started with signatures
- Getting started with file previews
- Getting started with the organizational chart
- Getting started with users and groups
-
Getting started with the
Table data type - Dynamic event type calculation
- Use cases
- API
In this article
Access permissions
Are used to set and get a list of permissions for app items (ApplicationItem), the app (Application) itself, and files (FileItem).
For example, you can get a list of access permissions configured for an app in the following way:
const p_settings = await Application.getPermissions(); const permissions = p_settings.__permissions;
Let’s grant a user permissions to create items in an app:
const user = Context.data.__createdBy; const permissions = new Permissions([new PermissionValue(user, [PermissionType.CREATE])]); await Application.setPermissions(permissions);
Now let’s check whether a user has permissions to create items:
const user = Context.data.__createdBy; await Application.hasPermission(user, PermissionType.CREATE);
Note that different types of permissions (PermissionType) are applied to different objects in the system. For instance, it is impossible to assign the creation permissions PermissionType.CREATE for an app item (not an app). Read more about access permissions in the Help Center: Access to app data.