mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
[PM-11203] Hide collection/item checkboxes in Admin Console (#10970)
* [PM-11203] Hide collection/item checkboxes in AC when a user does not have manage/edit permissions for the collection/item * [PM-11203] Remove restrict-provider-access flag * [PM-11203] Adjust the editableItems array to use existing canEdit and canDelete helpers to determine eligibility
This commit is contained in:
@@ -42,6 +42,7 @@ export class VaultCipherRowComponent implements OnInit {
|
||||
@Output() checkedToggled = new EventEmitter<void>();
|
||||
|
||||
protected CipherType = CipherType;
|
||||
protected organization?: Organization;
|
||||
|
||||
constructor(private configService: ConfigService) {}
|
||||
|
||||
@@ -53,6 +54,9 @@ export class VaultCipherRowComponent implements OnInit {
|
||||
this.extensionRefreshEnabled = await firstValueFrom(
|
||||
this.configService.getFeatureFlag$(FeatureFlag.ExtensionRefresh),
|
||||
);
|
||||
if (this.cipher.organizationId != null) {
|
||||
this.organization = this.organizations.find((o) => o.id === this.cipher.organizationId);
|
||||
}
|
||||
}
|
||||
|
||||
protected get showTotpCopyButton() {
|
||||
@@ -138,4 +142,12 @@ export class VaultCipherRowComponent implements OnInit {
|
||||
protected assignToCollections() {
|
||||
this.onEvent.emit({ type: "assignToCollections", items: [this.cipher] });
|
||||
}
|
||||
|
||||
protected get showCheckbox() {
|
||||
if (!this.viewingOrgVault || !this.organization) {
|
||||
return true; // Always show checkbox in individual vault or for non-org items
|
||||
}
|
||||
|
||||
return this.organization.canEditAllCiphers || this.cipher.edit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user