Skip to main content

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​

ParameterTypeDescription
eEntityEntity to check permission for
permission"Edit" | "View" | "Share" | "Delete" | string & objectPermission 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​

ParameterType
permissionstring

Returns​

Promise<boolean>


get()​

get(e): Promise<{ edit: Group[]; view: Group[]; }>

Defined in: js-api/src/dapi.ts:1072

Groups that can view the entity and groups that can edit it.

Parameters​

ParameterType
eEntity

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​

ParameterTypeDescription
eEntity-
gGroup-
editbooleanallow to edit entity

Returns​

Promise<void>