disable document form components when no object permissions

This commit is contained in:
Michael Shamoon
2022-12-07 15:46:52 -08:00
parent d15c701510
commit 8b204cac99
18 changed files with 116 additions and 21 deletions

View File

@@ -306,6 +306,7 @@ export class DocumentDetailComponent
.map((p) => p[0]),
}
this.documentForm.patchValue(doc)
if (!this.userCanEdit) this.documentForm.disable()
}
createDocumentType(newName: string) {
@@ -591,4 +592,14 @@ export class DocumentDetailComponent
})
)
}
get userCanEdit(): boolean {
return (
!this.document ||
this.permissionsService.currentUserHasObjectPermissions(
PermissionAction.Change,
this.document
)
)
}
}