mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 23:35:22 +01:00
Fix inherited permissions should not display per user in permissions form
This commit is contained in:
parent
4cfc416cdc
commit
ae0c585918
9 changed files with 58 additions and 11 deletions
|
|
@ -58,11 +58,16 @@ export class PermissionsService {
|
|||
action: string,
|
||||
object: ObjectWithPermissions
|
||||
): boolean {
|
||||
let actionObject = null
|
||||
if (action === PermissionAction.View) actionObject = object.permissions.view
|
||||
else if (action === PermissionAction.Change)
|
||||
actionObject = object.permissions.change
|
||||
if (!actionObject) return false
|
||||
return (
|
||||
this.currentUserOwnsObject(object) ||
|
||||
(object.permissions[action]['users'] as Array<number>)?.includes(
|
||||
this.currentUser.id
|
||||
)
|
||||
actionObject.users.includes(this.currentUser.id) ||
|
||||
actionObject.groups.filter((g) => this.currentUser.groups.includes(g))
|
||||
.length > 0
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue