Merge pull request #47149 from nextcloud/fix/disable-tags-editing

fix(files): Disable tags editing for shared files/folders with view only permission
This commit is contained in:
John Molakvoæ 2024-08-09 13:52:30 +02:00 committed by GitHub
commit 81b01c26c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 6 deletions

View file

@ -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 = () => Boolean(fileInfo.permissions & OC.PERMISSION_UPDATE)
return fileInfo
}

View file

@ -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"

View file

@ -15,6 +15,7 @@
:options="sortedTags"
:value="selectedTags"
:create-option="createOption"
:disabled="disabled"
:taggable="true"
:passthru="true"
:fetch-tags="false"
@ -65,6 +66,10 @@ export default Vue.extend({
type: Number,
required: true,
},
disabled: {
type: Boolean,
default: false,
},
},
data() {

4
dist/core-common.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long