Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/files_sharing/src/actions/sharingStatusAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { getCurrentUser } from '@nextcloud/auth'
import { generateAvatarSvg } from '../utils/AccountIcon.ts'

import './sharingStatusAction.scss'
import { showError } from '@nextcloud/dialogs'

const isExternal = (node: Node) => {
return node.attributes.remote_id !== undefined
Expand Down Expand Up @@ -135,15 +136,23 @@ export const action = new FileAction({
return true
}

// You need share permissions to share this file
// and read permissions to see the sidebar
return (node.permissions & Permission.SHARE) !== 0
&& (node.permissions & Permission.READ) !== 0
},

async exec(node: Node, view: View, dir: string) {
// You need read permissions to see the sidebar
if ((node.permissions & Permission.READ) !== 0) {
window.OCA?.Files?.Sidebar?.setActiveTab?.('sharing')
return sidebarAction.exec(node, view, dir)
sidebarAction.exec(node, view, dir)
return null
}

// Should not happen as the enabled check should prevent this
// leaving it here for safety or in case someone calls this action directly
showError(t('files_sharing', 'You do not have enough permissions to share this file.'))
return null
},

Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/federatedfilesharing-vue-settings-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-admin.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-init.js

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions dist/files_sharing-init.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
2 changes: 1 addition & 1 deletion dist/files_sharing-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-admin-delegation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-admin-delegation.js.map

Large diffs are not rendered by default.

Loading