diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-07-16 20:39:28 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-07-18 19:47:11 +0200 |
commit | 43ca07809d7d95f4896e9b1839c02d1344b51f83 (patch) | |
tree | c58f74d2da571b12273e321a6e24ae38d8b7d21b | |
parent | fec615c140b9b1fdb3cced43ca53a60a6118f250 (diff) | |
download | nextcloud-server-43ca07809d7d95f4896e9b1839c02d1344b51f83.tar.gz nextcloud-server-43ca07809d7d95f4896e9b1839c02d1344b51f83.zip |
fix(files_sharing): file request creation permissions and link copy display
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 6 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index f2ace7b4d70..1e6750a5bce 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -596,8 +596,10 @@ class ShareAPIController extends OCSController { throw new OCSNotFoundException($this->l->t('Invalid permissions')); } - // Shares always require read permissions - $permissions |= Constants::PERMISSION_READ; + // Shares always require read permissions OR create permissions + if (($permissions & Constants::PERMISSION_READ) === 0 && ($permissions & Constants::PERMISSION_CREATE) === 0) { + $permissions |= Constants::PERMISSION_READ; + } if ($node instanceof \OCP\Files\File) { // Single file shares should never have delete or create permissions diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 7fad50ebc95..ad3f4033b28 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -25,8 +25,8 @@ </div> <!-- clipboard --> - <NcActions v-if="share && !isEmailShareType && share.token" ref="copyButton" class="sharing-entry__copy"> - <NcActionButton :title="copyLinkTooltip" + <NcActions v-if="share && (!isEmailShareType || isFileRequest) && share.token" ref="copyButton" class="sharing-entry__copy"> + <NcActionButton :title="copyLinkTooltip" :aria-label="copyLinkTooltip" @click.prevent="copyLink"> <template #icon> |