ModelGenericExtensionsHasPermissionAll Method
Returns if the role contains all the entered permissions
Namespace: MobileTrack.Common.ExtensionsAssembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
public static bool HasPermissionAll(
this RoleDto roleDto,
params PermissionValueMap[] permissions
)
- roleDto RoleDto
- Role to check against
- permissions PermissionValueMap
- Permission to check against the role. If any of the permissions are correct, the method will return .
Boolean if the role has the permissionIn Visual Basic and C#, you can call this method as an instance method on any object of type
RoleDto. 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).
permissions is used to check if *any* of the entered permissions are correct, not if *all* are correct.
Therefore, invoking this method with for example parameters such as
ViewDevices
is correct because we're checking if the user has any of these 2 permissions;
but entering
ViewDevices and
ManageDevices is incorrect, as these have separate functions.