Skip to content

Commit

Permalink
fix(files): Disable tags editing for shared files/folders with view o…
Browse files Browse the repository at this point in the history
…nly permission

Signed-off-by: Konstantin Myakshin <molodchick@gmail.com>
  • Loading branch information
Koc committed Jul 21, 2024
1 parent fd1dabf commit 4a79261
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/files/src/services/FileInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default async function(url) {
// TODO remove when no more legacy backbone is used
fileInfo.get = (key) => fileInfo[key]
fileInfo.isDirectory = () => fileInfo.mimetype === 'httpd/unix-directory'
fileInfo.canEdit = () => fileInfo.permissions & OC.PERMISSION_UPDATE

return fileInfo
}
1 change: 1 addition & 0 deletions apps/files/src/views/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<div class="sidebar__description">
<SystemTags v-if="isSystemTagsEnabled && showTagsDefault"
v-show="showTags"
:disabled="!fileInfo?.canEdit()"
:file-id="fileInfo.id"
@has-tags="value => showTags = value" />
<LegacyView v-for="view in views"
Expand Down
6 changes: 6 additions & 0 deletions apps/systemtags/src/components/SystemTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:options="sortedTags"
:value="selectedTags"
:create-option="createOption"
:disabled="disabled"
:taggable="true"
:passthru="true"
:fetch-tags="false"
Expand Down Expand Up @@ -65,6 +66,11 @@ export default Vue.extend({
type: Number,
required: true,
},
disabled: {
type: Boolean,
required: false,
default: false,
},
},
data() {
Expand Down

0 comments on commit 4a79261

Please sign in to comment.