public MyPublicationViewModel.PermissionsSet Resolve(
     Publication source,
     MyPublicationViewModel destination,
     MyPublicationViewModel.PermissionsSet destMember,
     ResolutionContext context)
 {
     return(new MyPublicationViewModel.PermissionsSet
     {
         CanUpdatePublication = _userService
                                .CheckCanUpdatePublication(source)
                                .Result
                                .IsRight,
         CanUpdatePublicationTitle = _userService
                                     .CheckCanUpdatePublicationTitle()
                                     .Result
                                     .IsRight,
         CanCreateReleases = _userService
                             .CheckCanCreateReleaseForPublication(source)
                             .Result
                             .IsRight,
         CanAdoptMethodologies = _userService
                                 .CheckCanAdoptMethodologyForPublication(source)
                                 .Result
                                 .IsRight,
         CanCreateMethodologies = _userService
                                  .CheckCanCreateMethodologyForPublication(source)
                                  .Result
                                  .IsRight,
         CanManageExternalMethodology = _userService
                                        .CheckCanManageExternalMethodologyForPublication(source)
                                        .Result
                                        .IsRight
     });
 }
Example #2
0
 public MyPublicationViewModel.PermissionsSet Resolve(
     Publication source,
     MyPublicationViewModel destination,
     MyPublicationViewModel.PermissionsSet destMember,
     ResolutionContext context)
 {
     return(new MyPublicationViewModel.PermissionsSet
     {
         CanUpdatePublication = _userService
                                .CheckCanUpdatePublication(source)
                                .Result
                                .OnSuccess(_ => true)
                                .OrElse(() => false)
                                .Right,
         CanCreateReleases = _userService
                             .CheckCanCreateReleaseForPublication(source)
                             .Result
                             .OnSuccess(_ => true)
                             .OrElse(() => false)
                             .Right
     });
 }