1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +01:00

set collections for org admin

This commit is contained in:
Kyle Spearrin 2018-10-22 14:48:17 -04:00
parent 5e7c9a7278
commit 69f0339bd5
3 changed files with 11 additions and 1 deletions

2
jslib

@ -1 +1 @@
Subproject commit c946f01b5fbe5b84b928ae8dd4ad54a15dd1803d Subproject commit 3021afc9ddae1579f2226010ee487fa3edcddb0b

View File

@ -48,6 +48,13 @@ export class AddEditComponent extends BaseAddEditComponent {
await this.organizationChanged(); await this.organizationChanged();
} }
protected loadCollections() {
if (!this.organization.isAdmin) {
return super.loadCollections();
}
return Promise.resolve(this.collections);
}
protected async loadCipher() { protected async loadCipher() {
if (!this.organization.isAdmin) { if (!this.organization.isAdmin) {
return await super.loadCipher(); return await super.loadCipher();

View File

@ -238,6 +238,9 @@ export class VaultComponent implements OnInit, OnDestroy {
this.modal = this.cipherAddEditModalRef.createComponent(factory).instance; this.modal = this.cipherAddEditModalRef.createComponent(factory).instance;
const childComponent = this.modal.show<AddEditComponent>(AddEditComponent, this.cipherAddEditModalRef); const childComponent = this.modal.show<AddEditComponent>(AddEditComponent, this.cipherAddEditModalRef);
if (this.organization.isAdmin) {
childComponent.collections = this.groupingsComponent.collections.filter((c) => !c.readOnly);
}
childComponent.organization = this.organization; childComponent.organization = this.organization;
childComponent.cipherId = cipher == null ? null : cipher.id; childComponent.cipherId = cipher == null ? null : cipher.id;
childComponent.onSavedCipher.subscribe(async (c: CipherView) => { childComponent.onSavedCipher.subscribe(async (c: CipherView) => {