[EC-1086] The Remove individual vault Enterprise Policy prevents Service Users and Provider admins from creating new vault items via the Provider Portal. (#4909)

* [EC-1086] fix: faulty orgId override

When single vault policy was in effect the orgId that the user belongs to was was always set for new ciphers for new ciphers. This was overwriting the client organization's id when a provider was trying to create new items in their clients vault.

* [AC-1086] chore: remove uneccessary assignments
This commit is contained in:
Andreas Coroiu 2023-03-09 15:20:24 +01:00 committed by GitHub
parent f592963191
commit 6a6a47b52f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -223,7 +223,6 @@ export class VaultComponent implements OnInit, OnDestroy {
);
await this.editCipher(null, (comp) => {
comp.organizationId = this.organization.id;
comp.type = this.activeFilter.cipherType;
comp.collections = collections;
if (this.activeFilter.collectionId) {
@ -257,6 +256,7 @@ export class VaultComponent implements OnInit, OnDestroy {
const defaultComponentParameters = (comp: AddEditComponent) => {
comp.organization = this.organization;
comp.organizationId = this.organization.id;
comp.cipherId = cipherId;
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
comp.onSavedCipher.subscribe(async () => {
@ -301,7 +301,6 @@ export class VaultComponent implements OnInit, OnDestroy {
await this.editCipher(cipher, (comp) => {
comp.cloneMode = true;
comp.collections = collections;
comp.organizationId = this.organization.id;
comp.collectionIds = cipher.collectionIds;
});
}

View File

@ -201,7 +201,7 @@ export class AddEditComponent implements OnInit, OnDestroy {
this.ownershipOptions.push({ name: o.name, value: o.id });
}
});
if (!this.allowPersonal) {
if (!this.allowPersonal && this.organizationId == undefined) {
this.organizationId = this.defaultOwnerId;
}
}