mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-02 18:17:46 +01:00
[AC-2523] Fix broken members dialog for Manage Users custom permission (#8968)
* Let Manage Users permission edit collection access * Remove unused comment
This commit is contained in:
parent
6365dcdc43
commit
bb0a65f6d6
@ -619,7 +619,7 @@ export class MemberDialogComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
function mapCollectionToAccessItemView(
|
||||
collection: CollectionView,
|
||||
collection: CollectionAdminView,
|
||||
organization: Organization,
|
||||
flexibleCollectionsV1Enabled: boolean,
|
||||
accessSelection?: CollectionAccessSelectionView,
|
||||
@ -631,7 +631,8 @@ function mapCollectionToAccessItemView(
|
||||
labelName: collection.name,
|
||||
listName: collection.name,
|
||||
readonly:
|
||||
group !== undefined || !collection.canEdit(organization, flexibleCollectionsV1Enabled),
|
||||
group !== undefined ||
|
||||
!collection.canEditUserAccess(organization, flexibleCollectionsV1Enabled),
|
||||
readonlyPermission: accessSelection ? convertToPermission(accessSelection) : undefined,
|
||||
viaGroupName: group?.name,
|
||||
};
|
||||
|
@ -31,6 +31,9 @@ export class CollectionAdminView extends CollectionView {
|
||||
this.assigned = response.assigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the current user can edit the collection, including user and group access
|
||||
*/
|
||||
override canEdit(org: Organization, flexibleCollectionsV1Enabled: boolean): boolean {
|
||||
return org?.flexibleCollections
|
||||
? org?.canEditAnyCollection(flexibleCollectionsV1Enabled) || this.manage
|
||||
@ -43,4 +46,11 @@ export class CollectionAdminView extends CollectionView {
|
||||
? org?.canDeleteAnyCollection || (!org?.limitCollectionCreationDeletion && this.manage)
|
||||
: org?.canDeleteAnyCollection || (org?.canDeleteAssignedCollections && this.assigned);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user can modify user access to this collection
|
||||
*/
|
||||
canEditUserAccess(org: Organization, flexibleCollectionsV1Enabled: boolean): boolean {
|
||||
return this.canEdit(org, flexibleCollectionsV1Enabled) || org.canManageUsers;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user