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