From 82ca93db91fe723b8f18d093c550f8412c391202 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:11:39 -0600 Subject: [PATCH] [Policy] Personal Ownership (#605) * Initial commit of personal ownership * Saving updated merge conflicts * Updated jslib (dcbd09e -> 72bf18f) * Fixed casing --- jslib | 2 +- src/app/vault/add-edit.component.html | 2 +- src/app/vault/add-edit.component.ts | 11 +++++++++-- src/locales/en/messages.json | 3 +++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/jslib b/jslib index dcbd09e736b..72bf18f3690 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit dcbd09e736b516b359369f9d9fe5b0f5a6c2a928 +Subproject commit 72bf18f369068d36767794bdc0ca377f734cf373 diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html index 3613f148218..f564259cfa5 100644 --- a/src/app/vault/add-edit.component.html +++ b/src/app/vault/add-edit.component.html @@ -311,7 +311,7 @@ -
+
{{'ownership' | i18n}}
diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index 2fb79fd7e06..1dd27e2b38a 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -13,6 +13,7 @@ import { FolderService } from 'jslib/abstractions/folder.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { PolicyService } from 'jslib/abstractions/policy.service'; import { StateService } from 'jslib/abstractions/state.service'; import { UserService } from 'jslib/abstractions/user.service'; @@ -32,9 +33,10 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges, auditService: AuditService, stateService: StateService, userService: UserService, collectionService: CollectionService, messagingService: MessagingService, eventService: EventService, - private broadcasterService: BroadcasterService, private ngZone: NgZone) { + policyService: PolicyService, private broadcasterService: BroadcasterService, + private ngZone: NgZone) { super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, - userService, collectionService, messagingService, eventService); + userService, collectionService, messagingService, eventService, policyService); } async ngOnInit() { @@ -77,4 +79,9 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges, }); } } + + allowOwnershipOptions(): boolean { + return (!this.editMode || this.cloneMode) && this.ownershipOptions + && (this.ownershipOptions.length > 1 || !this.allowPersonal); + } } diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index b8e875c74b0..1710af535d9 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -1455,5 +1455,8 @@ }, "verifyBrowserDescription": { "message": "Please ensure the shown fingerprint is identical to the fingerprint showed in the browser extension." + }, + "personalOwnershipSubmitError": { + "message": "Due to an Enterprise Policy, you are restricted from saving items to your personal vault. Change the Ownership option to an organization and choose from available Collections." } }