diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-08-26 20:00:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-26 20:00:12 +0200 |
commit | 47584eee601594a066099b701e0ea61a5c8fec2a (patch) | |
tree | 472471347798c3a398698404b2ad1c59b20c7894 /apps/files | |
parent | efbe9724076823a55485096a8ec88544410d791e (diff) | |
parent | d1317e75409bdb2f37129ce07aee621bbe2b1a6c (diff) | |
download | nextcloud-server-47584eee601594a066099b701e0ea61a5c8fec2a.tar.gz nextcloud-server-47584eee601594a066099b701e0ea61a5c8fec2a.zip |
Merge pull request #33713 from nextcloud/bugfix/noid/viewonlyfix
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/fileactions.js | 9 | ||||
-rw-r--r-- | apps/files/js/fileinfomodel.js | 13 |
2 files changed, 20 insertions, 2 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 9b86c6521ae..f342f21a4fb 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -673,6 +673,9 @@ displayName: function(context) { var permissions = context.fileInfoModel.attributes.permissions; if (permissions & OC.PERMISSION_UPDATE) { + if (!context.fileInfoModel.canDownload()) { + return t('files', 'Move'); + } return t('files', 'Move or copy'); } return t('files', 'Copy'); @@ -685,7 +688,11 @@ var permissions = context.fileInfoModel.attributes.permissions; var actions = OC.dialogs.FILEPICKER_TYPE_COPY; if (permissions & OC.PERMISSION_UPDATE) { - actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE; + if (!context.fileInfoModel.canDownload()) { + actions = OC.dialogs.FILEPICKER_TYPE_MOVE; + } else { + actions = OC.dialogs.FILEPICKER_TYPE_COPY_MOVE; + } } var dialogDir = context.dir; if (typeof context.fileList.dirInfo.dirLastCopiedTo !== 'undefined') { diff --git a/apps/files/js/fileinfomodel.js b/apps/files/js/fileinfomodel.js index 83a8c62592b..79575109656 100644 --- a/apps/files/js/fileinfomodel.js +++ b/apps/files/js/fileinfomodel.js @@ -126,7 +126,18 @@ }); return deferred.promise(); - } + }, + + canDownload: function() { + for (const i in this.attributes.shareAttributes) { + const attr = this.attributes.shareAttributes[i] + if (attr.scope === 'permissions' && attr.key === 'download') { + return attr.enabled + } + } + + return true + }, }); if (!OCA.Files) { |