Exemple #1
0
        public bool CheckPermissionForUser(int userId, AccessFunctions permission)
        {
            var usuario = _context.Set <Usuario>().Include(x => x.Rol).FirstOrDefault(x => x.Id == userId);

            return(usuario.Rol.Permisos.Contains(((int)permission).ToString()));
        }
Exemple #2
0
 public PermissionRequirement(AccessFunctions permission)
 {
     Permission = permission;
 }
Exemple #3
0
 public bool HasPermisos(AccessFunctions accessFunction)
 {
     return(AccountPermisos.Contains(((int)accessFunction).ToString()));
 }