mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-01 11:19:32 -05:00
Fix: dont lose permissions ui if owner changed from null (#5433)
This commit is contained in:
parent
ee4cd11dab
commit
d6adccf7e5
@ -861,8 +861,11 @@ export class DocumentDetailComponent
|
||||
get userIsOwner(): boolean {
|
||||
let doc: Document = Object.assign({}, this.document)
|
||||
// dont disable while editing
|
||||
if (this.document && this.store?.value.permissions_form?.owner) {
|
||||
doc.owner = this.store?.value.permissions_form?.owner
|
||||
if (
|
||||
this.document &&
|
||||
this.store?.value.permissions_form?.hasOwnProperty('owner')
|
||||
) {
|
||||
doc.owner = this.store.value.permissions_form.owner
|
||||
}
|
||||
return !this.document || this.permissionsService.currentUserOwnsObject(doc)
|
||||
}
|
||||
@ -870,8 +873,11 @@ export class DocumentDetailComponent
|
||||
get userCanEdit(): boolean {
|
||||
let doc: Document = Object.assign({}, this.document)
|
||||
// dont disable while editing
|
||||
if (this.document && this.store?.value.permissions_form?.owner) {
|
||||
doc.owner = this.store?.value.permissions_form?.owner
|
||||
if (
|
||||
this.document &&
|
||||
this.store?.value.permissions_form?.hasOwnProperty('owner')
|
||||
) {
|
||||
doc.owner = this.store.value.permissions_form.owner
|
||||
}
|
||||
return (
|
||||
!this.document ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user