1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +00:00

Allow organizational admins to assign clone ownership (#458)

This commit is contained in:
Vincent Salucci
2020-02-12 15:11:38 -06:00
committed by GitHub
parent 6ed991593a
commit b7cd18b715
3 changed files with 17 additions and 3 deletions

View File

@@ -42,6 +42,17 @@ export class AddEditComponent extends BaseAddEditComponent {
eventService);
}
protected allowOwnershipAssignment() {
if (this.ownershipOptions != null && this.ownershipOptions.length > 1) {
if (this.organization != null) {
return this.cloneMode && this.organization.isAdmin;
} else {
return !this.editMode || this.cloneMode;
}
}
return false;
}
protected loadCollections() {
if (!this.organization.isAdmin) {
return super.loadCollections();
@@ -67,7 +78,7 @@ export class AddEditComponent extends BaseAddEditComponent {
}
protected async saveCipher(cipher: Cipher) {
if (!this.organization.isAdmin) {
if (!this.organization.isAdmin || cipher.organizationId == null) {
return super.saveCipher(cipher);
}
if (this.editMode && !this.cloneMode) {