mirror of
https://github.com/bitwarden/web
synced 2025-12-27 13:43:21 +00:00
Let organizations disable anonymous sends only
This commit is contained in:
@@ -32,9 +32,6 @@
|
||||
<app-callout type="warning" *ngIf="type === policyType.PersonalOwnership">
|
||||
{{'personalOwnershipExemption' | i18n}}
|
||||
</app-callout>
|
||||
<app-callout type="warning" *ngIf="type === policyType.DisableSend">
|
||||
{{'disableSendExemption' | i18n}}
|
||||
</app-callout>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="enabled" [(ngModel)]="enabled"
|
||||
@@ -147,6 +144,21 @@
|
||||
<label class="form-check-label" for="passGenIncludeNumber">{{'includeNumber' | i18n}}</label>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="type === policyType.DisableSend">
|
||||
<app-callout type="warning">
|
||||
{{'disableSendExemption' | i18n}}
|
||||
</app-callout>
|
||||
<div class="form-group">
|
||||
<label>{{'disabledSendType' | i18n}}</label>
|
||||
<div class="form-check" *ngFor="let o of disableSendPolicyOptions">
|
||||
<input class="form-check-input" type="radio" [(ngModel)]="disabledSends" name="Type_{{o.value}}"
|
||||
id="type_{{o.value}}" [value]="o.value" [checked]="disabledSends === o.value">
|
||||
<label class="form-check-label" for="type_{{o.value}}">
|
||||
{{o.name}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||
|
||||
@@ -13,6 +13,7 @@ import { ApiService } from 'jslib/abstractions/api.service';
|
||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||
|
||||
import { PolicyType } from 'jslib/enums/policyType';
|
||||
import { DisableSendPolicyType } from 'jslib/enums/disableSendPolicyType';
|
||||
|
||||
import { PolicyRequest } from 'jslib/models/request/policyRequest';
|
||||
|
||||
@@ -36,6 +37,7 @@ export class PolicyEditComponent implements OnInit {
|
||||
formPromise: Promise<any>;
|
||||
passwordScores: any[];
|
||||
defaultTypes: any[];
|
||||
disableSendPolicyOptions: any[];
|
||||
|
||||
// Master password
|
||||
|
||||
@@ -60,6 +62,10 @@ export class PolicyEditComponent implements OnInit {
|
||||
passGenCapitalize?: boolean;
|
||||
passGenIncludeNumber?: boolean;
|
||||
|
||||
// Disable Send
|
||||
|
||||
disabledSends: DisableSendPolicyType = DisableSendPolicyType.DisableAll;
|
||||
|
||||
private policy: PolicyResponse;
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
@@ -77,6 +83,10 @@ export class PolicyEditComponent implements OnInit {
|
||||
{ name: i18nService.t('password'), value: 'password' },
|
||||
{ name: i18nService.t('passphrase'), value: 'passphrase' },
|
||||
];
|
||||
this.disableSendPolicyOptions = [
|
||||
{ name: i18nService.t('disableAllSends'), value: DisableSendPolicyType.DisableAll },
|
||||
{ name: i18nService.t('disableAnonymousSends'), value: DisableSendPolicyType.DisableAnonymous }
|
||||
]
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -113,6 +123,10 @@ export class PolicyEditComponent implements OnInit {
|
||||
this.masterPassRequireNumbers = this.policy.data.requireNumbers;
|
||||
this.masterPassRequireSpecial = this.policy.data.requireSpecial;
|
||||
break;
|
||||
case PolicyType.DisableSend:
|
||||
this.disabledSends = this.policy.data.disabledSends ||
|
||||
DisableSendPolicyType.DisableAll;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -159,6 +173,11 @@ export class PolicyEditComponent implements OnInit {
|
||||
requireSpecial: this.masterPassRequireSpecial,
|
||||
};
|
||||
break;
|
||||
case PolicyType.DisableSend:
|
||||
request.data = {
|
||||
disableSendPolicy: this.disabledSends,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3621,9 +3621,18 @@
|
||||
"message": "Disable Send"
|
||||
},
|
||||
"disableSendPolicyDesc": {
|
||||
"message": "Do not allow users to create or edit a Bitwarden Send. Deleting an existing Send is still allowed.",
|
||||
"message": "Do not allow users to create or edit a Bitwarden Send of a particular type. Deleting an existing Send is still allowed.",
|
||||
"description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated."
|
||||
},
|
||||
"disabledSendType": {
|
||||
"message": "Disable these Sends"
|
||||
},
|
||||
"disableAllSends": {
|
||||
"message": "Disable all Sends"
|
||||
},
|
||||
"disableAnonymousSends": {
|
||||
"message": "Disable anonymous Sends only"
|
||||
},
|
||||
"disableSendExemption": {
|
||||
"message": "Organization users that can manage the organization's policies are exempt from this policy's enforcement."
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user