- 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]
- 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 - Use cases
- How to set up custom view of app items
- How to set up dynamic display of fields and widgets with a complex condition
- How to register a document
- How to calculate the number of days between two dates
- How to create a substitution for a user
- How to use pagination and sorting when searching for app items
- API
- Object types
- Data types
- Global constants
- Work with apps
- Web requests
- Access permissions
- Document flow
- Live Chats
- “Code” widget
- Signatures
- Business calendars
- Integration with IP telephony
- Integration with email marketing services
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.