ModelGenericExtensionsHasPermissionAll Method

Returns if the role contains all the entered permissions

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
public static bool HasPermissionAll(
	this RoleDto roleDto,
	params PermissionValueMap[] permissions
)

Parameters

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 .

Return Value

Boolean
if the role has the permission

Usage Note

In 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).

Remarks

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.

See Also