Пример #1
0
 public T GetUser <T>() where T : class
 {
     if (UserId == null)
     {
         return(null);
     }
     return(SecurityProvider.GetPermissionAsync(UserId).Result as T);
 }
Пример #2
0
 public bool IsInDynamicRole(object role)
 {
     if (UserId != null)
     {
         var permission = SecurityProvider.GetPermissionAsync(UserId).Result;
         return(permission.IsInRole(role));
     }
     return(false);
 }
Пример #3
0
 public Task <T> GetUserAsync <T>() where T : class
 {
     return(SecurityProvider.GetPermissionAsync(UserId).ContinueWith(t => t.Result as T));
 }