示例#1
0
 public GalleryViewModel(
     AlbumViewModel currentUserAlbum,
     IList<AlbumViewModel> otherPeopleAlbums,
     AlbumListViewModel standardAlbums,
     AlbumViewModel selected
     )
 {
     this.CurrentUserAlbum = currentUserAlbum;
     this.OtherPeopleAlbums = otherPeopleAlbums.AsReadOnly();
     this.StandardAlbums = standardAlbums;
     this.Selected = selected;
 }
示例#2
0
 public bool IsSelected(AlbumViewModel albumModel)
 {
     return this.Selected != null
         && this.Selected == albumModel;
 }
示例#3
0
        private void SetupSecurityManagement(AlbumViewModel model)
        {
            if (!authorization.IsAuthorized(this.User, SecurableActions.ManageSecurity))
                return;

            model.SetupSecurityManagement(
                from userOrGroup in this.authorization.GetAuthorizedTo(SecurableActions.View(model.Album))
                where !(userOrGroup is AnonymousMember)
                select new UserGroupViewModel(userOrGroup)
            );
        }