Ejemplo n.º 1
0
 public EFAccountEdit GetUser()
 {
     if (SelectedUser == null)
     {
         return(null);
     }
     using (IMetadataUsers client = App.CurrentBaseApp.GetUsersContext())
     {
         var user = client.GetUser(SelectedUser.Id);
         if (user != null)
         {
             var account = new EFAccountEdit();
             account.EFAccount = user;
             if (user.Permissions == null)
             {
                 user.Permissions = ByteExtensions.GetDefaultPermissions(BaseApplication.CurrentBaseApp.UserPermissionAttributes, Permission.Read);
             }
             account.UserPermissions = UserPermissionEdit.GetPermissionEdits(BaseApplication.CurrentBaseApp.UserPermissionAttributes, user.Permissions);
             return(account);
         }
         return(null);
     }
 }