Skip to content

Commit

Permalink
CRISTAL-257: The edit button is presented even if the current user do…
Browse files Browse the repository at this point in the history
…es not have edit rights

* Hide edit button when edition is disabled
* Improve comments
  • Loading branch information
pjeanjean committed Dec 23, 2024
1 parent 6d82a3e commit 9de0786
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/backends/backend-xwiki/src/xwikiStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class XWikiStorage extends AbstractStorage {
try {
json = await response.json();
if (!response.ok) {
// TODO: Fix CRISTAL-383
// TODO: Fix CRISTAL-383 (Error messages in Storages are not translated)
this.alertsServiceProvider
.get()
.error(`Could not load page ${page}. Reason: ${json.error}`);
Expand Down Expand Up @@ -318,7 +318,7 @@ export class XWikiStorage extends AbstractStorage {
});
if (!response.ok) {
const errorMessage = await response.text();
// TODO: Fix CRISTAL-383
// TODO: Fix CRISTAL-383 (Error messages in Storages are not translated)
this.alertsServiceProvider
.get()
.error(`Could not save page ${page}. Reason: ${errorMessage}`);
Expand Down
7 changes: 2 additions & 5 deletions skin/src/vue/c-content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,8 @@ onUpdated(() => {
<template #doc-page-actions>
<div class="doc-page-actions">
<router-link
:to="
currentPageRevision || !currentPage?.canEdit
? ''
: { name: 'edit', params: { page: currentPageName } }
"
v-if="!currentPageRevision && currentPage?.canEdit"
:to="{ name: 'edit', params: { page: currentPageName } }"
>
<x-btn
size="small"
Expand Down

0 comments on commit 9de0786

Please sign in to comment.