Disable suggestions for read-only docs

This commit is contained in:
shamoon 2023-03-03 15:21:02 -08:00
parent ef627d53e5
commit ae46ef7add

View File

@ -306,6 +306,12 @@ export class DocumentDetailComponent
) )
}, },
}) })
if (
this.permissionsService.currentUserHasObjectPermissions(
PermissionAction.Change,
doc
)
) {
this.documentsService this.documentsService
.getSuggestions(doc.id) .getSuggestions(doc.id)
.pipe(first()) .pipe(first())
@ -320,6 +326,7 @@ export class DocumentDetailComponent
) )
}, },
}) })
}
this.title = this.documentTitlePipe.transform(doc.title) this.title = this.documentTitlePipe.transform(doc.title)
const docFormValues = Object.assign({}, doc) const docFormValues = Object.assign({}, doc)
docFormValues['permissions_form'] = { docFormValues['permissions_form'] = {