diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptScope.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptScope.cs index 15fbe8efb..012dfed56 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptScope.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ScriptScope.cs @@ -10,14 +10,15 @@ namespace Squidex.Domain.Apps.Core.Scripting [Flags] public enum ScriptScope { - Async, - AssetScript, - AssetTrigger, - ContentScript, - ContentTrigger, - Transform, - SchemaTrigger, - UsageTrigger, - CommentTrigger + None = 0, + AssetScript = 1, + AssetTrigger = 2, + Async = 4, + CommentTrigger = 8, + ContentScript = 16, + ContentTrigger = 32, + SchemaTrigger = 128, + Transform = 256, + UsageTrigger = 512, } } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs index 23702ac5c..3f657aeb4 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs @@ -250,7 +250,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject private async Task ChangeCore(ChangeContentStatus c, ContentOperation operation) { - operation.MustHavePermission(Permissions.AppContentsChangeStatusOwn); + operation.MustHavePermission(Permissions.AppContentsChangeStatus); operation.MustNotChangeSingleton(c.Status); if (c.Status == Snapshot.EditingStatus()) @@ -383,7 +383,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject private async Task ValidateCore(ContentOperation operation) { - operation.MustHavePermission(Permissions.AppContentsReadOwn); + operation.MustHavePermission(Permissions.AppContentsRead); await operation.ValidateContentAndInputAsync(Snapshot.Data, false, Snapshot.IsPublished()); } @@ -408,7 +408,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject private async Task DeleteCore(DeleteContent c, ContentOperation operation) { - operation.MustHavePermission(Permissions.AppContentsDeleteOwn); + operation.MustHavePermission(Permissions.AppContentsDelete); operation.MustNotDeleteSingleton(); if (!c.DoNotScript) diff --git a/frontend/src/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts b/frontend/src/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts index 81327a766..4760773a8 100644 --- a/frontend/src/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/scripts/schema-scripts-form.component.ts @@ -6,7 +6,7 @@ */ import { Component, Input, OnChanges } from '@angular/core'; -import { EMPTY, Observable } from 'rxjs'; +import { EMPTY, Observable, shareReplay } from 'rxjs'; import { AppsState, EditSchemaScriptsForm, SchemaCompletions, SchemaDto, SchemasService, SchemasState } from '@app/shared'; @Component({ @@ -38,7 +38,7 @@ export class SchemaScriptsFormComponent implements OnChanges { this.editForm.load(this.schema.scripts); this.editForm.setEnabled(this.isEditable); - this.schemaCompletions = this.schemasService.getCompletions(this.appsState.appName, this.schema.name); + this.schemaCompletions = this.schemasService.getCompletions(this.appsState.appName, this.schema.name).pipe(shareReplay(1)); } public selectField(field: string) { diff --git a/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.ts b/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.ts index 3c8bcb0f5..942a44f26 100644 --- a/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.ts +++ b/frontend/src/app/features/settings/pages/asset-scripts/asset-scripts-page.component.ts @@ -6,7 +6,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { EMPTY, Observable } from 'rxjs'; +import { EMPTY, Observable, shareReplay } from 'rxjs'; import { AppsState, AssetCompletions, AssetScriptsState, AssetsService, EditAssetScriptsForm, ResourceOwner } from '@app/shared'; @Component({ @@ -31,7 +31,7 @@ export class AssetScriptsPageComponent extends ResourceOwner implements OnInit { } public ngOnInit() { - this.assetCompletions = this.assetsService.getCompletions(this.appsState.appName); + this.assetCompletions = this.assetsService.getCompletions(this.appsState.appName).pipe(shareReplay(1)); this.assetScriptsState.scripts .subscribe(scripts => {