diff --git a/client/src/components/PageDisplay/PageDisplay.vue b/client/src/components/PageDisplay/PageDisplay.vue index 9994a67a0274..f476a35c7bbd 100644 --- a/client/src/components/PageDisplay/PageDisplay.vue +++ b/client/src/components/PageDisplay/PageDisplay.vue @@ -9,6 +9,7 @@ :enable_beta_markdown_export="config.enable_beta_markdown_export" :download-endpoint="stsUrl(config)" :export-link="exportUrl" + :read-only="!userOwnsPage" @onEdit="onEdit" /> @@ -25,6 +26,8 @@ import ConfigProvider from "components/providers/ConfigProvider"; import Markdown from "components/Markdown/Markdown"; import Published from "components/Common/Published"; import PageHtml from "./PageHtml"; +import { mapState } from "pinia"; +import { useUserStore } from "@/stores/userStore"; export default { components: { @@ -45,6 +48,10 @@ export default { }; }, computed: { + ...mapState(useUserStore, ["currentUser"]), + userOwnsPage() { + return this.currentUser.username === this.page.username; + }, dataUrl() { return `/api/pages/${this.pageId}`; },