mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
implement superuser select-permissions disable
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
<label class="form-check-label" for="is_active" i18n>Active</label>
|
||||
</div>
|
||||
<div class="form-check form-switch form-check-inline">
|
||||
<input type="checkbox" class="form-check-input" id="is_superuser" formControlName="is_superuser">
|
||||
<label class="form-check-label" for="is_superuser" i18n>Superuser</label>
|
||||
<input type="checkbox" class="form-check-input" id="is_superuser" formControlName="is_superuser" (change)="onToggleSuperUser()">
|
||||
<label class="form-check-label" for="is_superuser"><ng-container i18n>Superuser</ng-container> <small class="form-text text-muted ms-1" i18n>(Grants all permissions)</small></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -48,4 +48,12 @@ export class UserEditDialogComponent extends EditDialogComponent<PaperlessUser>
|
||||
user_permissions: new FormControl(null),
|
||||
})
|
||||
}
|
||||
|
||||
onToggleSuperUser() {
|
||||
if (this.objectForm.get('is_superuser').value) {
|
||||
this.objectForm.get('user_permissions').disable()
|
||||
} else {
|
||||
this.objectForm.get('user_permissions').enable()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user