//checks if a user is signed in public static bool IsSignedIn(ISession session) { return(AuthenticationHandler.CurrentUser(session).RoleID != 0); }
//checks if current user meets authorization requirements public static bool IsAuthorized(User user, ValidRole role) { return(AuthenticationHandler.GetDatabaseInstance(user).RoleID == (int)role); }
//checks if current user meets authorization requirements public static bool IsAuthorized(User user, string role) { return(AuthenticationHandler.GetDatabaseInstance(user).Role.RoleName == role); }