Esempio n. 1
0
        public override string[] GetRolesForUser(string username)
        {
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
            {
                return(null);
            }
            string[] code;
            using (var db = new AvenzoSeguridadEntities()) {
                code = db.Usuarios.Where(U => U.Usuario == username).Select(x => x.Roles).FirstOrDefault().Split(',');
            }

            return(code);
        }
Esempio n. 2
0
 public override string[] GetRolesForUser(string username)
 {
     // throw new NotImplementedException();
     using (AvenzoSeguridadEntities objContext = new AvenzoSeguridadEntities())
     {
         var objUser = objContext.Usuarios.Where(x => x.Usuario == username).FirstOrDefault();
         if (objUser != null)
         {
             var code = objUser.Roles;
             return(new[] { code });
         }
     }
     return(null);
 }