mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Hide email address in Sends (#310)
* Let organizations disable anonymous Sends only * Add HideEmail to send models and service * Delete unnecessary model * Enforce new Send policy, fix naming conventions * Fix linting * Fully disable editing anonymous Sends per policy * Revert disableSendPolicy, add sendOptionsPolicy * Rework UI for enforcing disableHideEmail * Fix linting and cleanup after refactor
This commit is contained in:
@@ -47,6 +47,7 @@ export class AddEditComponent implements OnInit {
|
||||
|
||||
copyLink = false;
|
||||
disableSend = false;
|
||||
disableHideEmail = false;
|
||||
send: SendView;
|
||||
deletionDate: string;
|
||||
deletionDateFallback: string;
|
||||
@@ -149,14 +150,23 @@ export class AddEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
async load() {
|
||||
const policies = await this.policyService.getAll(PolicyType.DisableSend);
|
||||
const disableSendPolicies = await this.policyService.getAll(PolicyType.DisableSend);
|
||||
const organizations = await this.userService.getAllOrganizations();
|
||||
this.disableSend = organizations.some(o => {
|
||||
return o.enabled &&
|
||||
o.status === OrganizationUserStatusType.Confirmed &&
|
||||
o.usePolicies &&
|
||||
!o.canManagePolicies &&
|
||||
policies.some(p => p.organizationId === o.id && p.enabled);
|
||||
disableSendPolicies.some(p => p.organizationId === o.id && p.enabled);
|
||||
});
|
||||
|
||||
const sendOptionsPolicies = await this.policyService.getAll(PolicyType.SendOptions);
|
||||
this.disableHideEmail = await organizations.some(o => {
|
||||
return o.enabled &&
|
||||
o.status === OrganizationUserStatusType.Confirmed &&
|
||||
o.usePolicies &&
|
||||
!o.canManagePolicies &&
|
||||
sendOptionsPolicies.some(p => p.organizationId === o.id && p.enabled && p.data.disableHideEmail);
|
||||
});
|
||||
|
||||
this.canAccessPremium = await this.userService.canAccessPremium();
|
||||
|
||||
Reference in New Issue
Block a user