public bool IsAdministrator() { bool retval = false; var userId = User.Identity.GetUserId(); DatabaseControler dc = new DatabaseControler(); var user = dc.GetUserById(userId); if (dc.GetUserRoles(user).Contains("ADMINISTRATOR")) { retval = true; } return retval; }
public static bool IsAdministrator(string Id) { bool retval = false; DatabaseControler dc = new DatabaseControler(); ApplicationUser user = dc.GetUserById(Id); if (dc.GetUserRoles(user).Contains("ADMINISTRATOR")) { retval = true; } return(retval); }