mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-27 17:18:04 +01:00
Allow organizational admins to assign clone ownership (#458)
This commit is contained in:
parent
6ed991593a
commit
b7cd18b715
@ -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) {
|
||||
|
@ -439,8 +439,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container
|
||||
*ngIf="(!editMode || cloneMode) && !organization && ownershipOptions && ownershipOptions.length > 1">
|
||||
<ng-container *ngIf="allowOwnershipAssignment()">
|
||||
<h3 class="mt-4">{{'ownership' | i18n}}</h3>
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
|
@ -154,6 +154,10 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
}
|
||||
}
|
||||
|
||||
protected allowOwnershipAssignment() {
|
||||
return (!this.editMode || this.cloneMode) && this.ownershipOptions != null && this.ownershipOptions.length > 1;
|
||||
}
|
||||
|
||||
private async totpTick(intervalSeconds: number) {
|
||||
const epoch = Math.round(new Date().getTime() / 1000.0);
|
||||
const mod = epoch % intervalSeconds;
|
||||
|
Loading…
Reference in New Issue
Block a user