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 462a82e0122..88f22c892ee 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 @@ -64,6 +64,12 @@ +
+ {{ "grantCollectionAccess" | i18n }} + {{ + " " + ("adminCollectionAccess" | i18n) + }} +
(); protected organizations$: Observable; @@ -134,10 +138,6 @@ export class CollectionDialogComponent implements OnInit, OnDestroy { this.formGroup.patchValue({ selectedOrg: this.params.organizationId }); await this.loadOrg(this.params.organizationId, this.params.collectionIds); } - - if (await firstValueFrom(this.flexibleCollectionsEnabled$)) { - this.formGroup.controls.access.addValidators(validateCanManagePermission); - } } async loadOrg(orgId: string, collectionIds: string[]) { @@ -162,10 +162,19 @@ export class CollectionDialogComponent implements OnInit, OnDestroy { groups: groups$, users: this.organizationUserService.getAllUsers(orgId), flexibleCollections: this.flexibleCollectionsEnabled$, + flexibleCollectionsV1: this.flexibleCollectionsV1Enabled$, }) .pipe(takeUntil(this.formGroup.controls.selectedOrg.valueChanges), takeUntil(this.destroy$)) .subscribe( - ({ organization, collections, collectionDetails, groups, users, flexibleCollections }) => { + ({ + organization, + collections, + collectionDetails, + groups, + users, + flexibleCollections, + flexibleCollectionsV1, + }) => { this.organization = organization; this.accessItems = [].concat( groups.map(mapGroupToAccessItemView), @@ -223,6 +232,13 @@ export class CollectionDialogComponent implements OnInit, OnDestroy { }); } + if (flexibleCollectionsV1 && !organization.allowAdminAccessToAllCollectionItems) { + this.formGroup.controls.access.addValidators(validateCanManagePermission); + } else { + this.formGroup.controls.access.removeValidators(validateCanManagePermission); + } + this.formGroup.controls.access.updateValueAndValidity(); + this.loading = false; }, ); diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 5d7d4a35396..35420dd4982 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -7447,6 +7447,12 @@ "collectionAccessRestricted": { "message": "Collection access is restricted" }, + "grantCollectionAccess": { + "message": "Grant groups or members access to this collection." + }, + "adminCollectionAccess": { + "message": "Administrators can access and manage collections." + }, "serviceAccountAccessUpdated": { "message": "Service account access updated" }