1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-24 11:55:50 +01:00

Disable Private Vault Export Policy (#1068)

This commit is contained in:
Oscar Hinton 2021-09-15 20:02:17 +02:00 committed by GitHub
parent e8da01bafb
commit da4af743f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 8 deletions

2
jslib

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

View File

@ -2,6 +2,9 @@
<div class="modal-dialog" role="document">
<form class="modal-content" #form (ngSubmit)="submit()">
<div class="modal-body">
<app-callout type="warning" title="{{'vaultExportDisabled' | i18n}}" *ngIf="disabledByPolicy">
{{'personalVaultExportPolicyInEffect' | i18n}}
</app-callout>
<div class="box">
<div class="box-header" id="exportTitle">
{{'exportVault' | i18n}}
@ -9,7 +12,7 @@
<div class="box-content">
<div class="box-content-row" appBoxRow>
<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="csv">.csv</option>
<option value="encrypted_json">.json (Encrypted)</option>
@ -20,7 +23,7 @@
<label for="masterPassword">{{'masterPass' | i18n}}</label>
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}"
name="MasterPassword" class="monospaced" [(ngModel)]="masterPassword" required
appAutofocus>
appAutofocus [disabled]="disabledByPolicy">
</div>
<div class="action-buttons">
<a class="row-btn" href="#" appStopClick appBlurClick role="button"
@ -37,7 +40,8 @@
</div>
</div>
<div class="modal-footer">
<button appBlurClick type="submit" class="primary" appA11yTitle="{{'submit' | i18n}}">
<button appBlurClick type="submit" class="primary" appA11yTitle="{{'submit' | i18n}}"
[disabled]="disabledByPolicy">
<i class="fa fa-download fa-lg fa-fw" aria-hidden="true"></i>
</button>
<button type="button" data-dismiss="modal">{{'cancel' | i18n}}</button>

View File

@ -1,7 +1,6 @@
import {
Component,
NgZone,
OnDestroy,
OnInit,
} from '@angular/core';
@ -16,6 +15,7 @@ import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.se
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
import { ExportComponent as BaseExportComponent } from 'jslib-angular/components/export.component';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
const BroadcasterSubscriptionId = 'ExportComponent';
@ -26,12 +26,13 @@ const BroadcasterSubscriptionId = 'ExportComponent';
export class ExportComponent extends BaseExportComponent implements OnInit {
constructor(cryptoService: CryptoService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, exportService: ExportService,
eventService: EventService, private broadcasterService: BroadcasterService,
private ngZone: NgZone) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, window);
eventService: EventService, policyService: PolicyService,
private broadcasterService: BroadcasterService, private ngZone: NgZone) {
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService, window);
}
async ngOnInit() {
super.ngOnInit();
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
this.ngZone.run(() => {
switch (message.command) {

View File

@ -1708,5 +1708,11 @@
},
"resetPasswordAutoEnrollInviteWarning": {
"message": "This organization has an enterprise policy that will automatically enroll you in password reset. Enrollment will allow organization administrators to change your master password."
},
"vaultExportDisabled": {
"message": "Vault Export Disabled"
},
"personalVaultExportPolicyInEffect": {
"message": "One or more organization policies prevents you from exporting your personal vault."
}
}