Browse Source

Check for published state when querying content.

pull/107/head
Sebastian Stehle 9 years ago
parent
commit
2d1f7b5c94
  1. 4
      src/Squidex.Domain.Apps.Read/Contents/ContentQueryService.cs

4
src/Squidex.Domain.Apps.Read/Contents/ContentQueryService.cs

@ -60,11 +60,13 @@ namespace Squidex.Domain.Apps.Read.Contents
Guard.NotNull(user, nameof(user));
Guard.NotNullOrEmpty(schemaIdOrName, nameof(schemaIdOrName));
var isFrontendClient = user.IsInClient("squidex-frontend");
var schema = await FindSchemaAsync(app, schemaIdOrName);
var content = await contentRepository.FindContentAsync(app, schema, id);
if (content == null)
if (content == null || (!content.IsPublished && !isFrontendClient))
{
throw new DomainObjectNotFoundException(id.ToString(), typeof(ISchemaEntity));
}

Loading…
Cancel
Save