public async Task Should_throw_for_single_content_if_no_permission()
        {
            SetupUser(false, false);
            SetupSchemaFound();

            var ctx = requestContext;

            await Assert.ThrowsAsync <DomainForbiddenException>(() => sut.FindContentAsync(ctx, schemaId.Name, contentId));
        }
示例#2
0
        public async Task FindContentAsync_should_throw_exception_if_user_has_no_permission()
        {
            var ctx = CreateContext(isFrontend: false, allowSchema: false);

            A.CallTo(() => contentRepository.FindContentAsync(ctx.App, schema, contentId, A <SearchScope> ._))
            .Returns(CreateContent(contentId));

            await Assert.ThrowsAsync <DomainForbiddenException>(() => sut.FindContentAsync(ctx, schemaId.Name, contentId));
        }