Disable Private Vault Export Policy (#2064)

This commit is contained in:
Oscar Hinton 2021-09-15 21:06:13 +02:00 committed by GitHub
parent bc908df348
commit 205b1153de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 8 deletions

2
jslib

@ -1 +1 @@
Subproject commit a85c45a34ed90b09f59ec27bdba754d66452915e Subproject commit ee1ea922a9d5a51ef8df2abf4b97fc035ed782be

View File

@ -1764,7 +1764,7 @@
}, },
"updateMasterPasswordWarning": { "updateMasterPasswordWarning": {
"message": "Your Master Password was recently changed by an administrator in your organization. In order to access the vault, you must update it now. Proceeding will log you out of your current session, requiring you to log back in. Active sessions on other devices may continue to remain active for up to one hour." "message": "Your Master Password was recently changed by an administrator in your organization. In order to access the vault, you must update it now. Proceeding will log you out of your current session, requiring you to log back in. Active sessions on other devices may continue to remain active for up to one hour."
}, },
"resetPasswordPolicyAutoEnroll": { "resetPasswordPolicyAutoEnroll": {
"message": "Automatic Enrollment" "message": "Automatic Enrollment"
}, },
@ -1798,5 +1798,11 @@
}, },
"vaultTimeoutToLarge": { "vaultTimeoutToLarge": {
"message": "Your vault timeout exceeds the restrictions set by your organization." "message": "Your vault timeout exceeds the restrictions set by your organization."
},
"vaultExportDisabled": {
"message": "Vault Export Disabled"
},
"personalVaultExportPolicyInEffect": {
"message": "One or more organization policies prevents you from exporting your personal vault."
} }
} }

View File

@ -5,7 +5,7 @@ let clickedEl: HTMLElement = null;
// Find the best attribute to be used as the Name for an element in a custom field. // Find the best attribute to be used as the Name for an element in a custom field.
function getClickedElementIdentifier() { function getClickedElementIdentifier() {
if (clickedEl == null) { if (clickedEl == null) {
return 'Unable to identify clicked element.' return 'Unable to identify clicked element.';
} }
if (!inputTags.includes(clickedEl.nodeName.toLowerCase())) { if (!inputTags.includes(clickedEl.nodeName.toLowerCase())) {

View File

@ -10,15 +10,19 @@
<span class="title">{{'exportVault' | i18n}}</span> <span class="title">{{'exportVault' | i18n}}</span>
</div> </div>
<div class="right"> <div class="right">
<button appBlurClick type="submit">{{'submit' | i18n}}</button> <button appBlurClick type="submit" [disabled]="disabledByPolicy">{{'submit' | i18n}}</button>
</div> </div>
</header> </header>
<content> <content>
<app-callout type="warning" title="{{'vaultExportDisabled' | i18n}}" *ngIf="disabledByPolicy">
{{'personalVaultExportPolicyInEffect' | i18n}}
</app-callout>
<div class="box"> <div class="box">
<div class="box-content"> <div class="box-content">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="format">{{'fileFormat' | i18n}}</label> <label for="format">{{'fileFormat' | i18n}}</label>
<select id="format" name="Format" [(ngModel)]="format"> <select id="format" name="Format" [(ngModel)]="format" [disabled]="disabledByPolicy">
<option value="json">.json</option> <option value="json">.json</option>
<option value="csv">.csv</option> <option value="csv">.csv</option>
<option value="encrypted_json">.json (Encrypted)</option> <option value="encrypted_json">.json (Encrypted)</option>
@ -28,7 +32,8 @@
<div class="row-main"> <div class="row-main">
<label for="masterPassword">{{'masterPass' | i18n}}</label> <label for="masterPassword">{{'masterPass' | i18n}}</label>
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}" name="MasterPassword" <input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}" name="MasterPassword"
class="monospaced" [(ngModel)]="masterPassword" required appInputVerbatim appAutofocus> class="monospaced" [(ngModel)]="masterPassword" required appInputVerbatim appAutofocus
[disabled]="disabledByPolicy">
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
<a class="row-btn" href="#" appStopClick appBlurClick <a class="row-btn" href="#" appStopClick appBlurClick

View File

@ -6,6 +6,7 @@ import { EventService } from 'jslib-common/abstractions/event.service';
import { ExportService } from 'jslib-common/abstractions/export.service'; import { ExportService } from 'jslib-common/abstractions/export.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { ExportComponent as BaseExportComponent } from 'jslib-angular/components/export.component'; import { ExportComponent as BaseExportComponent } from 'jslib-angular/components/export.component';
@ -16,8 +17,8 @@ import { ExportComponent as BaseExportComponent } from 'jslib-angular/components
export class ExportComponent extends BaseExportComponent { export class ExportComponent extends BaseExportComponent {
constructor(cryptoService: CryptoService, i18nService: I18nService, constructor(cryptoService: CryptoService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, exportService: ExportService, platformUtilsService: PlatformUtilsService, exportService: ExportService,
eventService: EventService, private router: Router) { eventService: EventService, policyService: PolicyService, private router: Router) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, window); super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService, window);
} }
protected saved() { protected saved() {