SessionDataExtensionsGetUserPermissionsForItem Method

Retrieves all user permissions a user has for a scope, either directly or from ancestor environments.

Definition

Namespace: MobileTrack.DataContainers.Extensions
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
public static Task<AccessModel> GetUserPermissionsForItem(
	this UserSessionData currentUser,
	IAzureCosmosDb cosmosDb,
	IHasEnvironment item,
	CancellationToken cancellationToken = default
)

Parameters

currentUser  UserSessionData
Current user to receive the permissions for
cosmosDb  IAzureCosmosDb
Cosmos DB
item  IHasEnvironment
Scope
cancellationToken  CancellationToken  (Optional)
Cancellation token

Return Value

TaskAccessModel
Access model containing all permissions and whether unauthorized items should be hidden or grayed out

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type UserSessionData. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionThrown if cosmosDb or item is

See Also