public async Task UpdateLegacyRelease_PublicationRoles()
            {
                var legacyRelease = new LegacyRelease
                {
                    PublicationId = Guid.NewGuid(),
                };

                await AssertHandlerOnlySucceedsWithPublicationRoles <UpdateLegacyReleaseRequirement, LegacyRelease>(
                    legacyRelease.PublicationId,
                    legacyRelease,
                    contentDbContext => contentDbContext.Add(legacyRelease),
                    contentDbContext =>
                    new UpdateLegacyReleaseAuthorizationHandler(
                        new UserPublicationRoleRepository(contentDbContext)),
                    PublicationRole.Owner);
            }
예제 #2
0
 public static Task <Either <ActionResult, LegacyRelease> > CheckCanDeleteLegacyRelease(
     this IUserService userService, LegacyRelease legacyRelease)
 {
     return(userService.CheckPolicy(legacyRelease, SecurityPolicies.CanDeleteLegacyRelease));
 }