PermissionAPI interface
An interface representing permission related APIs
Methods
| check |
Checks if sharing is enable for current user on this item. |
| check |
Checks if the current user has specific permissions on the target item. |
| check |
Checks if the current user has specific permissions on array of items |
| check |
Checks if the current user has specific permissions on the target workspace. |
| get |
Gets shareable permissions of the specific item type. |
| get |
Gets permissions of the current user on the target item. |
| get |
Gets permissions of users on the target item. |
| get |
Gets permissions of the current user on the target workspace. |
| get |
Gets all users with access to the target item. Only fabric items are supported. |
| open |
Opens the item sharing dialog. |
| open |
Opens the item sharing dialog with sharing result(Currently only link sharing dialog supports to return sharing result). |
Method Details
checkItemSharingEnabled(CheckItemSharingEnabledInput)
Checks if sharing is enable for current user on this item.
function checkItemSharingEnabled(input: CheckItemSharingEnabledInput): Promise<CheckItemSharingEnabledResult>
Parameters
CheckItemSharingEnabledInput including:
itemType: The item type of the target item.itemObjectId: The object Id of the target item.
Returns
Promise<CheckItemSharingEnabledResult>
The check result
checkPermissionsOfItem(CheckPermissionsOfItemInput)
Checks if the current user has specific permissions on the target item.
function checkPermissionsOfItem(input: CheckPermissionsOfItemInput): Promise<CheckPermissionsOfItemResult>
Parameters
CheckPermissionsOfItemInput including:
itemType: The item type of the target item.itemObjectId: The object Id of the target item.permissions: The core permissions to check if user has.itemPermissions: The customized permissions to check if user has.
Returns
Promise<CheckPermissionsOfItemResult>
The check result
checkPermissionsOfItems(CheckPermissionsOfItemsInput)
Checks if the current user has specific permissions on array of items
function checkPermissionsOfItems(input: CheckPermissionsOfItemsInput): Promise<CheckPermissionsOfItemsResult>
Parameters
CheckPermissionsOfItemsInput including:
inputs: Permission check inputs
Returns
Promise<CheckPermissionsOfItemsResult>
The check result
checkPermissionsOfWorkspace(CheckPermissionsOfWorkspaceInput)
Checks if the current user has specific permissions on the target workspace.
function checkPermissionsOfWorkspace(input: CheckPermissionsOfWorkspaceInput): Promise<CheckPermissionsOfWorkspaceResult>
Parameters
CheckPermissionsOfWorkspaceInput including:
workspaceObjectId: The object Id of the target workspace.permissions: The permissions to check if user has.
Returns
Promise<CheckPermissionsOfWorkspaceResult>
The check result.
getItemTypeShareablePermissions(GetItemTypeShareablePermissionsInput)
Gets shareable permissions of the specific item type.
function getItemTypeShareablePermissions(input: GetItemTypeShareablePermissionsInput): Promise<GetItemTypeShareablePermissionsResult>
Parameters
GetItemTypeShareablePermissionsInput including:
itemType: The item type.
Returns
The result is GetItemTypeShareablePermissionsResult which including:
corePermissions: The shareable core permissions of this item type.itemPermissions: The shareable item permissions of this item type.
getPermissionsOfItem(GetPermissionsOfItemInput)
Gets permissions of the current user on the target item.
function getPermissionsOfItem(input: GetPermissionsOfItemInput): Promise<GetPermissionsOfItemResult>
Parameters
GetPermissionsOfItemInput including:
itemType: The item type of the target item.itemObjectId: The object Id of the target item.
Returns
Promise<GetPermissionsOfItemResult>
The result is GetPermissionsOfItemResult which including:
permissions: The core permissions user has.itemPermissions: The customized permissions user has. Always return 0 for non-fabric items.
getPermissionsOfItemByUser(GetPermissionsOfItemByUserInput)
Gets permissions of users on the target item.
function getPermissionsOfItemByUser(input: GetPermissionsOfItemByUserInput): Promise<GetPermissionsOfItemByUserResult>
Parameters
GetPermissionsOfItemByUserInput including:
itemObjectId: The object Id of the target item.userObjectIds: The object Id list of users to query.
Returns
Promise<GetPermissionsOfItemByUserResult>
The result is GetPermissionsOfItemByUserResult which including:
permissionUsers: The list to map users being queried and their permissions to the item.
getPermissionsOfWorkspace(GetPermissionsOfWorkspaceInput)
Gets permissions of the current user on the target workspace.
function getPermissionsOfWorkspace(input: GetPermissionsOfWorkspaceInput): Promise<GetPermissionsOfWorkspaceResult>
Parameters
GetPermissionsOfWorkspaceInput including:
workspaceObjectId: The object Id of the target workspace.
Returns
Promise<GetPermissionsOfWorkspaceResult>
The result is GetPermissionsOfWorkspaceResult which including:
permissions: The permissions user has.
getUsersWithAccessToItem(GetUsersWithAccessToItemInput)
Gets all users with access to the target item. Only fabric items are supported.
function getUsersWithAccessToItem(input: GetUsersWithAccessToItemInput): Promise<GetUsersWithAccessToItemResult>
Parameters
GetUsersWithAccessToItemInput including:
itemObjectId: The object Id of the target item.
Returns
Promise<GetUsersWithAccessToItemResult>
The result is GetUsersWithAccessToItemResult including:
usersWithAccessToItemList: The list containing all users with access to the target item and their permissions.
openItemSharingDialog(ItemSharingDialogConfig)
Opens the item sharing dialog.
function openItemSharingDialog(config: ItemSharingDialogConfig)
Parameters
- config
- ItemSharingDialogConfig
ItemSharingDialogConfig including:
itemType: The item type of the target item.itemObjectId: The object Id of the target item.linkSharing: If this flag is true, open link sharing dialog, otherwise open direct sharing dialog. - Optional with default value truepreSelectedUserPrincipals: A list of user principal names to grant access by default. - Optional. Only supported in direct sharing dialogpreSelectedUserObjectIDs: A list of user object ids to grant access by default. - Optional. Only supported in direct sharing dialogdefaultShareOptions: A list of share option names to be checked by default. - Optional. Only supported in direct sharing dialog. Note that empty array is different from undefined and will uncheck all share optionscustomizedTitle: A customized title to replace grant access title in sharing literals. Needs to be localized. - Optional and only supported in direct sharing dialog
openItemSharingDialogWithResult(ItemSharingDialogConfig)
Opens the item sharing dialog with sharing result(Currently only link sharing dialog supports to return sharing result).
function openItemSharingDialogWithResult(config: ItemSharingDialogConfig): Promise<SharingResult>
Parameters
- config
- ItemSharingDialogConfig
ItemSharingDialogConfig including:
itemType: The item type of the target item.itemObjectId: The object Id of the target item.linkSharing: If this flag is true, open link sharing dialog, otherwise open direct sharing dialog. - Optional with default value truepreSelectedUserPrincipals: A list of user principal names to grant access by default. - Optional. Only supported in direct sharing dialogpreSelectedUserObjectIDs: A list of user object ids to grant access by default. - Optional. Only supported in direct sharing dialogdefaultShareOptions: A list of share option names to be checked by default. - Optional. Only supported in direct sharing dialog. Note that empty array is different from undefined and will uncheck all share optionscustomizedTitle: A customized title to replace grant access title in sharing literals. Needs to be localized. - Optional and only supported in direct sharing dialog
Returns
Promise<SharingResult>
The result is SharingResult which including:
sharingCompleted: If the sharing has been completed successfully.scope: If the sharing is tenant scope sharing, specific users sharing or existing access(no new sharing)sharedUsers: object id of shared userspermissions: shared core permissionsitemPermissions: shared customized permissionsrelatedSharingPermissions: shared permissions of related item