From fb7273beb894b33db8b62f853b3d056656342856 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Thu, 30 May 2024 10:49:32 +1000 Subject: [PATCH] [AC-2703] Fix copy in members and groups modals for custom users (#9408) * Fix copy in members and groups modals for custom users * Fix nesting in member dialog template --- .../manage/group-add-edit.component.html | 2 +- .../manage/group-add-edit.component.ts | 11 ++++++++--- .../member-dialog/member-dialog.component.html | 14 +++++++++++--- .../member-dialog/member-dialog.component.ts | 13 +++++++++---- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html b/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html index df731c5cf1..166467ada0 100644 --- a/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html +++ b/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html @@ -52,7 +52,7 @@

{{ "editGroupCollectionsDesc" | i18n }} - + {{ "restrictedCollectionAssignmentDesc" | i18n }}

diff --git a/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.ts b/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.ts index a02c4a8da9..38ef002534 100644 --- a/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.ts +++ b/apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.ts @@ -196,12 +196,17 @@ export class GroupAddEditComponent implements OnInit, OnDestroy { }), ); - protected canEditAnyCollection$ = combineLatest([ + protected canAssignAccessToAnyCollection$ = combineLatest([ this.organization$, this.flexibleCollectionsV1Enabled$, + this.allowAdminAccessToAllCollectionItems$, ]).pipe( - map(([org, flexibleCollectionsV1Enabled]) => - org.canEditAnyCollection(flexibleCollectionsV1Enabled), + map( + ([org, flexibleCollectionsV1Enabled, allowAdminAccessToAllCollectionItems]) => + org.canEditAnyCollection(flexibleCollectionsV1Enabled) || + // Manage Groups custom permission cannot edit any collection but they can assign access from this dialog + // if permitted by collection management settings + (org.permissions.manageGroups && allowAdminAccessToAllCollectionItems), ), ); diff --git a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html index 35e28b5239..149277b817 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html +++ b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html @@ -278,9 +278,17 @@
{{ "cannotAddYourselfToCollections" | i18n }}
-
- {{ "userPermissionOverrideHelperDesc" | i18n }} - +
+ + {{ "userPermissionOverrideHelperDesc" | i18n }} + + {{ "restrictedCollectionAssignmentDesc" | i18n }}
diff --git a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts index 8309d4d725..8482cbb4de 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts @@ -107,7 +107,7 @@ export class MemberDialogComponent implements OnDestroy { protected allowAdminAccessToAllCollectionItems$: Observable; protected restrictEditingSelf$: Observable; - protected canEditAnyCollection$: Observable; + protected canAssignAccessToAnyCollection$: Observable; protected permissionsGroup = this.formBuilder.group({ manageAssignedCollectionsGroup: this.formBuilder.group>({ @@ -222,12 +222,17 @@ export class MemberDialogComponent implements OnDestroy { FeatureFlag.FlexibleCollectionsV1, ); - this.canEditAnyCollection$ = combineLatest([ + this.canAssignAccessToAnyCollection$ = combineLatest([ this.organization$, flexibleCollectionsV1Enabled$, + this.allowAdminAccessToAllCollectionItems$, ]).pipe( - map(([org, flexibleCollectionsV1Enabled]) => - org.canEditAnyCollection(flexibleCollectionsV1Enabled), + map( + ([org, flexibleCollectionsV1Enabled, allowAdminAccessToAllCollectionItems]) => + org.canEditAnyCollection(flexibleCollectionsV1Enabled) || + // Manage Users custom permission cannot edit any collection but they can assign access from this dialog + // if permitted by collection management settings + (org.permissions.manageUsers && allowAdminAccessToAllCollectionItems), ), );