예제 #1
0
 public UserWithPermissionsContract ToContract()
 {
     return(new UserWithPermissionsContract {
         Active = this.Active,
         GroupId = this.GroupId,
         Id = this.Id,
         Name = this.Name,
         OwnedArtistEntries = OwnedArtists.ToArray(),
         AdditionalPermissions = new HashSet <PermissionToken>(Permissions.Where(p => p.HasFlag).Select(p => PermissionToken.GetById(p.PermissionType.Id)))
     });
 }
예제 #2
0
 public ServerOnlyUserWithPermissionsContract ToContract()
 {
     return(new ServerOnlyUserWithPermissionsContract
     {
         Active = Active,
         Email = Email ?? string.Empty,
         GroupId = GroupId,
         Id = Id,
         Name = Name,
         OwnedArtistEntries = OwnedArtists.ToArray(),
         Poisoned = Poisoned,
         Supporter = Supporter,
         AdditionalPermissions = new HashSet <PermissionToken>(Permissions.Where(p => p.HasFlag).Select(p => PermissionToken.GetById(p.PermissionType.Id)))
     });
 }