mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
Fix: use default permissions for objects created via dropdown (#4778)
This commit is contained in:
parent
5b502b1e1a
commit
47a2ded30d
4 changed files with 10 additions and 6 deletions
|
|
@ -131,6 +131,7 @@ describe('EditDialogComponent', () => {
|
|||
})
|
||||
|
||||
it('should interpolate object permissions', () => {
|
||||
component.getMatchingAlgorithms() // coverage
|
||||
component.object = tag
|
||||
component.dialogMode = EditDialogMode.EDIT
|
||||
component.ngOnInit()
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ export abstract class EditDialogComponent<
|
|||
objectForm: FormGroup = this.getForm()
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.object != null) {
|
||||
if (this.object['permissions']) {
|
||||
if (this.object != null && this.dialogMode !== EditDialogMode.CREATE) {
|
||||
if ((this.object as ObjectWithPermissions).permissions) {
|
||||
this.object['set_permissions'] = this.object['permissions']
|
||||
}
|
||||
|
||||
|
|
@ -69,6 +69,8 @@ export abstract class EditDialogComponent<
|
|||
}
|
||||
this.objectForm.patchValue(this.object)
|
||||
} else {
|
||||
// e.g. if name was set
|
||||
this.objectForm.patchValue(this.object)
|
||||
// defaults from settings
|
||||
this.objectForm.patchValue({
|
||||
permissions_form: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue