diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-07-15 15:52:04 +0300 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-08-03 14:24:20 +0300 |
commit | 146dda4266e8b5252a4c0eff1ad3552e2dd651f5 (patch) | |
tree | 8acbd712deab47c10a622745cc9b59d3c81cc9b3 /apps/files_sharing/src | |
parent | e959b57c31c07f53e0de3398957f56217354cf73 (diff) |
Enforcing permission during resharing
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 1 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingInput.vue | 1 | ||||
-rw-r--r-- | apps/files_sharing/src/mixins/ShareRequests.js | 5 |
3 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 638cdf485b0..d5acf64c202 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -696,6 +696,7 @@ export default { shareType: ShareTypes.SHARE_TYPE_LINK, password: share.password, expireDate: share.expireDate, + attributes: JSON.stringify(this.fileInfo.shareAttributes), // we do not allow setting the publicUpload // before the share creation. // Todo: We also need to fix the createShare method in diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index 02c1f27f173..716e96a4e06 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -478,6 +478,7 @@ export default { shareWith: value.shareWith, password, permissions: this.fileInfo.sharePermissions & OC.getCapabilities().files_sharing.default_permissions, + attributes: JSON.stringify(this.fileInfo.shareAttributes), }) // If we had a password, we need to show it to the user as it was generated diff --git a/apps/files_sharing/src/mixins/ShareRequests.js b/apps/files_sharing/src/mixins/ShareRequests.js index e2668c15d65..9eaad8c4161 100644 --- a/apps/files_sharing/src/mixins/ShareRequests.js +++ b/apps/files_sharing/src/mixins/ShareRequests.js @@ -47,12 +47,13 @@ export default { * @param {boolean} [data.sendPasswordByTalk=false] send the password via a talk conversation * @param {string} [data.expireDate=''] expire the shareautomatically after * @param {string} [data.label=''] custom label + * @param {string} [data.attributes=null] Share attributes encoded as json * @return {Share} the new share * @throws {Error} */ - async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) { + async createShare({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label, attributes }) { try { - const request = await axios.post(shareUrl, { path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) + const request = await axios.post(shareUrl, { path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label, attributes }) if (!request?.data?.ocs) { throw request } |