mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 01:26:47 +01:00
Refactor permissions API endpoints, UI group permissions
This commit is contained in:
parent
f2d635671d
commit
211fbf0cf6
29 changed files with 353 additions and 139 deletions
|
|
@ -39,14 +39,7 @@ export abstract class EditDialogComponent<
|
|||
ngOnInit(): void {
|
||||
if (this.object != null) {
|
||||
if (this.object['permissions']) {
|
||||
this.object['set_permissions'] = {
|
||||
view: (this.object as ObjectWithPermissions).permissions
|
||||
.filter((p) => (p[1] as string).includes('view'))
|
||||
.map((p) => p[0]),
|
||||
change: (this.object as ObjectWithPermissions).permissions
|
||||
.filter((p) => (p[1] as string).includes('change'))
|
||||
.map((p) => p[0]),
|
||||
}
|
||||
this.object['set_permissions'] = this.object['permissions']
|
||||
}
|
||||
this.objectForm.patchValue(this.object)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue