PermissionsDataSource
Defined in: js-api/src/dapi.ts:1067
Permissions API: checking, granting and revoking permissions on entities, and checking the
global ones (grok.dapi.permissions).
Constructors
Constructor
new PermissionsDataSource():
PermissionsDataSource
Defined in: js-api/src/dapi.ts:1068
Returns
PermissionsDataSource
Methods
check()
check(
e,permission):Promise<boolean>
Defined in: js-api/src/dapi.ts:1083
Checks if current user has permission {permission} for entity {e}
Parameters
| Parameter | Type | Description |
|---|---|---|
e | Entity | Entity to check permission for |
permission | "Edit" | "View" | "Share" | "Delete" | string & object | Permission type, or a privilege of the entity's type (DataQuery.Execute) |
Returns
Promise<boolean>
Result
checkGlobal()
checkGlobal(
permission):Promise<boolean>
Defined in: js-api/src/dapi.ts:1090
Checks if the current user holds a global permission — one granted on no entity, such as
DG.Permission.CREATE_DOMAIN_SCHEMA. Asks the server every time: a grant since login
counts, and an impersonated call answers for the impersonated user.
Parameters
| Parameter | Type |
|---|---|
permission | string |
Returns
Promise<boolean>
get()
Defined in: js-api/src/dapi.ts:1072
Groups that can view the entity and groups that can edit it.
Parameters
| Parameter | Type |
|---|---|
e | Entity |
Returns
Promise<{ edit: Group[]; view: Group[]; }>
grant()
grant(
e,g,edit):Promise<void>
Defined in: js-api/src/dapi.ts:1096
Grants permission on entity to the group
Parameters
| Parameter | Type | Description |
|---|---|---|
e | Entity | - |
g | Group | - |
edit | boolean | allow to edit entity |
Returns
Promise<void>