mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 19:53:43 +00:00
Feature/split manage collections permission (#1211)
* Update guard services and routing * Add depenent checkbox to handle sub permissions * Present new collections premissions * Use new split permissions * Rename to nested-checkbox.component * Clarify css class name * update jslib
This commit is contained in:
@@ -42,7 +42,7 @@ export class CiphersComponent extends BaseCiphersComponent {
|
||||
}
|
||||
|
||||
async load(filter: (cipher: CipherView) => boolean = null) {
|
||||
if (this.organization.canManageAllCollections) {
|
||||
if (this.organization.canViewAllCollections) {
|
||||
this.accessEvents = this.organization.useEvents;
|
||||
this.allCiphers = await this.cipherService.getAllFromApiForOrganization(this.organization.id);
|
||||
} else {
|
||||
@@ -54,7 +54,7 @@ export class CiphersComponent extends BaseCiphersComponent {
|
||||
}
|
||||
|
||||
async applyFilter(filter: (cipher: CipherView) => boolean = null) {
|
||||
if (this.organization.canManageAllCollections) {
|
||||
if (this.organization.canViewAllCollections) {
|
||||
await super.applyFilter(filter);
|
||||
} else {
|
||||
const f = (c: CipherView) => c.organizationId === this.organization.id && (filter == null || filter(c));
|
||||
@@ -70,13 +70,13 @@ export class CiphersComponent extends BaseCiphersComponent {
|
||||
}
|
||||
|
||||
protected deleteCipher(id: string) {
|
||||
if (!this.organization.canManageAllCollections) {
|
||||
if (!this.organization.canEditAnyCollection) {
|
||||
return super.deleteCipher(id, this.deleted);
|
||||
}
|
||||
return this.deleted ? this.apiService.deleteCipherAdmin(id) : this.apiService.putDeleteCipherAdmin(id);
|
||||
}
|
||||
|
||||
protected showFixOldAttachments(c: CipherView) {
|
||||
return this.organization.canManageAllCollections && c.hasOldAttachments;
|
||||
return this.organization.canEditAnyCollection && c.hasOldAttachments;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user