Esempio n. 1
0
 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;
 }
Esempio n. 2
0
        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);
        }