Skip to content

Commit

Permalink
Merge pull request #2094 from nextcloud/backport/stable28/2093
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Dec 7, 2023
2 parents 44e3f6d + 798d636 commit d74811d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,10 @@ export default {
iconSvgInline: () => EyeSvg,
default: DefaultType.DEFAULT,
enabled: (nodes) => {
// Disable if not located in user root
if (nodes.some(node => !(node.isDavRessource && node.root?.startsWith('/files')))) {
return false
}
// Faster to check if at least one node doesn't match the requirements
return !nodes.some(node => (
(node.permissions & Permission.READ) === 0
Expand Down

0 comments on commit d74811d

Please sign in to comment.