mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 16:25:33 +01:00
feat: reflect django permissions on UI
This commit is contained in:
parent
1dc271723c
commit
4603813896
24 changed files with 301 additions and 113 deletions
|
|
@ -553,6 +553,11 @@ export class DocumentDetailComponent
|
|||
}
|
||||
|
||||
get commentsEnabled(): boolean {
|
||||
return this.settings.get(SETTINGS_KEYS.COMMENTS_ENABLED)
|
||||
// TODO - Is this the only way to allow/disallow from permissions?
|
||||
var canViewComments = false
|
||||
this.settings.permissions().subscribe((perm) => {
|
||||
canViewComments = perm.includes('documents.view_comment')
|
||||
})
|
||||
return this.settings.get(SETTINGS_KEYS.COMMENTS_ENABLED) && canViewComments
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue