mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
[Reset Password] Custom Permission pairing (#1027)
This commit is contained in:
parent
c198ec32bb
commit
6d54740aaf
@ -172,7 +172,8 @@
|
||||
<div class="form-group mb-0">
|
||||
<div class="form-check mt-1 form-check-block">
|
||||
<input class="form-check-input" type="checkbox" name="manageUsers"
|
||||
id="manageUsers" [(ngModel)]="permissions.manageUsers">
|
||||
id="manageUsers" [(ngModel)]="permissions.manageUsers"
|
||||
(change)="handleDependentPermissions()">
|
||||
<label class="form-check-label font-weight-normal" for="manageUsers">
|
||||
{{'manageUsers' | i18n}}
|
||||
</label>
|
||||
@ -181,7 +182,8 @@
|
||||
<div class="form-group mb-0">
|
||||
<div class="form-check mt-1 form-check-block">
|
||||
<input class="form-check-input" type="checkbox" name="manageResetPassword"
|
||||
id="manageResetPassword" [(ngModel)]="permissions.manageResetPassword">
|
||||
id="manageResetPassword" [(ngModel)]="permissions.manageResetPassword"
|
||||
(change)="handleDependentPermissions()">
|
||||
<label class="form-check-label font-weight-normal" for="manageResetPassword">
|
||||
{{'manageResetPassword' | i18n}}
|
||||
</label>
|
||||
|
@ -143,6 +143,15 @@ export class UserAddEditComponent implements OnInit {
|
||||
return p;
|
||||
}
|
||||
|
||||
handleDependentPermissions() {
|
||||
// Manage Password Reset must have Manage Users enabled
|
||||
if (this.permissions.manageResetPassword && !this.permissions.manageUsers) {
|
||||
this.permissions.manageUsers = true;
|
||||
(document.getElementById('manageUsers') as HTMLInputElement).checked = true;
|
||||
this.platformUtilsService.showToast('info', null, this.i18nService.t('resetPasswordManageUsers'));
|
||||
}
|
||||
}
|
||||
|
||||
async submit() {
|
||||
let collections: SelectionReadOnlyRequest[] = null;
|
||||
if (this.access !== 'all') {
|
||||
|
@ -3995,5 +3995,8 @@
|
||||
},
|
||||
"error": {
|
||||
"message": "Error"
|
||||
},
|
||||
"resetPasswordManageUsers": {
|
||||
"message": "Manage Users must also be enabled with the Manage Password Reset permission"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user