feat: reflect django permissions on UI

This commit is contained in:
Kaaybi
2022-11-11 18:33:04 +00:00
parent 1dc271723c
commit 4603813896
24 changed files with 301 additions and 113 deletions

View File

@@ -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
}
}