mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[PM-7292] Fix viewing/editing unassigned ciphers for admins (#8627)
* [PM-7292] Introduce canEditUnassignedCiphers helper * [PM-7292] Use new canEditUnassignedCiphers helper * [PM-7292] Remove duplicate canUseAdminCollections helper
This commit is contained in:
@@ -662,7 +662,7 @@ export class AddEditComponent implements OnInit, OnDestroy {
|
||||
|
||||
// if a cipher is unassigned we want to check if they are an admin or have permission to edit any collection
|
||||
if (!cipher.collectionIds) {
|
||||
orgAdmin = this.organization?.canEditAllCiphers(this.flexibleCollectionsV1Enabled);
|
||||
orgAdmin = this.organization?.canEditUnassignedCiphers();
|
||||
}
|
||||
|
||||
return this.cipher.id == null
|
||||
|
||||
@@ -203,8 +203,9 @@ export class Organization {
|
||||
);
|
||||
}
|
||||
|
||||
canUseAdminCollections(flexibleCollectionsV1Enabled: boolean) {
|
||||
return this.canEditAnyCollection(flexibleCollectionsV1Enabled);
|
||||
canEditUnassignedCiphers() {
|
||||
// TODO: Update this to exclude Providers if provider access is restricted in AC-1707
|
||||
return this.isAdmin || this.permissions.editAnyCollection;
|
||||
}
|
||||
|
||||
canEditAllCiphers(flexibleCollectionsV1Enabled: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user