1
0
mirror of https://github.com/bitwarden/web synced 2026-01-06 02:24:02 +00:00

[Policy] Personal Ownership (#722)

* Initial commit of personal ownership policy

* Added event handling for modifying policies

* I didn't save the merge conflict fix...

* Removed unused import

* Updated jslib (dcbd09e -> 2d62e10)
This commit is contained in:
Vincent Salucci
2020-12-08 13:24:59 -06:00
committed by GitHub
parent a8af807650
commit 218caa28b0
7 changed files with 76 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { PolicyService } from 'jslib/abstractions/policy.service';
import { StateService } from 'jslib/abstractions/state.service';
import { TotpService } from 'jslib/abstractions/totp.service';
import { UserService } from 'jslib/abstractions/user.service';
@@ -41,9 +42,10 @@ export class AddEditComponent extends BaseAddEditComponent {
auditService: AuditService, stateService: StateService,
userService: UserService, collectionService: CollectionService,
protected totpService: TotpService, protected passwordGenerationService: PasswordGenerationService,
protected messagingService: MessagingService, eventService: EventService) {
protected messagingService: MessagingService, eventService: EventService,
protected policyService: PolicyService) {
super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService,
userService, collectionService, messagingService, eventService);
userService, collectionService, messagingService, eventService, policyService);
}
async ngOnInit() {
@@ -155,7 +157,8 @@ export class AddEditComponent extends BaseAddEditComponent {
}
protected allowOwnershipAssignment() {
return (!this.editMode || this.cloneMode) && this.ownershipOptions != null && this.ownershipOptions.length > 1;
return (!this.editMode || this.cloneMode) && this.ownershipOptions != null
&& (this.ownershipOptions.length > 1 || !this.allowPersonal);
}
private async totpTick(intervalSeconds: number) {