diff --git a/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.html b/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.html index b64ce5bb00..6adf6bcf8f 100644 --- a/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.html +++ b/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.html @@ -69,6 +69,13 @@ {{ "readOnlyCollectionAccess" | i18n }} + + {{ "grantAddAccessCollectionWarning" | i18n }} + {{ "grantCollectionAccess" | i18n }} {{ "grantCollectionAccessMembersOnly" | i18n @@ -84,7 +91,10 @@
{{ "managePermissionRequired" | i18n }}
diff --git a/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts b/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts index f386665186..8040cf13cd 100644 --- a/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts +++ b/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts @@ -59,6 +59,7 @@ export interface CollectionDialogParams { */ limitNestedCollections?: boolean; readonly?: boolean; + isAddAccessCollection?: boolean; } export interface CollectionDialogResult { @@ -100,6 +101,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy { }); protected PermissionMode = PermissionMode; protected showDeleteButton = false; + protected showAddAccessWarning = false; constructor( @Inject(DIALOG_DATA) private params: CollectionDialogParams, @@ -251,6 +253,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy { this.handleFormGroupReadonly(this.dialogReadonly); this.loading = false; + this.showAddAccessWarning = this.handleAddAccessWarning(flexibleCollectionsV1); }, ); } @@ -362,6 +365,18 @@ export class CollectionDialogComponent implements OnInit, OnDestroy { this.destroy$.complete(); } + private handleAddAccessWarning(flexibleCollectionsV1: boolean): boolean { + if ( + flexibleCollectionsV1 && + !this.organization?.allowAdminAccessToAllCollectionItems && + this.params.isAddAccessCollection + ) { + return true; + } + + return false; + } + private handleFormGroupReadonly(readonly: boolean) { if (readonly) { this.formGroup.controls.name.disable(); diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index 95dd9cab16..c8549e0b88 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -1222,6 +1222,7 @@ export class VaultComponent implements OnInit, OnDestroy { organizationId: this.organization?.id, initialTab: tab, readonly: readonly, + isAddAccessCollection: c.addAccess, limitNestedCollections: !this.organization.canEditAnyCollection( this.flexibleCollectionsV1Enabled, ), diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 9e5ad73a03..3c96dd5df7 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -7635,6 +7635,12 @@ "readOnlyCollectionAccess": { "message": "You do not have access to manage this collection." }, + "grantAddAccessCollectionWarningTitle": { + "message": "Missing Can Manage Permissions" + }, + "grantAddAccessCollectionWarning": { + "message": "Grant Can manage permissions to allow full collection management including deletion of collection." + }, "grantCollectionAccess": { "message": "Grant groups or members access to this collection." },