mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-28 22:59:03 -06:00
Change: restrict altering and creation of superusers to superusers only (#8837)
This commit is contained in:
@@ -160,4 +160,23 @@ describe('UserEditDialogComponent', () => {
|
||||
})
|
||||
expect(component.currentUserIsSuperUser).toBeTruthy()
|
||||
})
|
||||
|
||||
it('should disable superuser option if current user is not superuser', () => {
|
||||
const control: AbstractControl = component.objectForm.get('is_superuser')
|
||||
permissionsService.initialize([], {
|
||||
id: 99,
|
||||
username: 'user99',
|
||||
is_superuser: false,
|
||||
})
|
||||
component.ngOnInit()
|
||||
expect(control.disabled).toBeTruthy()
|
||||
|
||||
permissionsService.initialize([], {
|
||||
id: 99,
|
||||
username: 'user99',
|
||||
is_superuser: true,
|
||||
})
|
||||
component.ngOnInit()
|
||||
expect(control.disabled).toBeFalsy()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user