Пример #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()));
        }
Пример #2
0
 public PermissionRequirement(AccessFunctions permission)
 {
     Permission = permission;
 }
Пример #3
0
 public bool HasPermisos(AccessFunctions accessFunction)
 {
     return(AccountPermisos.Contains(((int)accessFunction).ToString()));
 }