IsInRoleAdmin System.Security.Principal.IPrincipal

.IsInRoleAdmin()

Is the supplied user granted an "Admin" role?

Method

public static bool IsInRoleAdmin(this System.Security.Principal.IPrincipal user)
System.Security.Principal.IPrincipal user

User to check for the Admin role.

Example

C#
bool isAdmin = Request.IsAuthenticated && User.IsInRoleAdmin();