diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2023-11-29 15:06:51 +0100 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2023-11-30 11:58:35 +0100 |
commit | 9d86a0444daaa6b98fa9013c42609a6d1b042173 (patch) | |
tree | d5c495ed77375f8faf3c8a7afaf9a4cb24b1fafd /apps/files_sharing/src/mixins/SharesMixin.js | |
parent | bcc1d57a038e8431b63eb9e1e5f76d0616a474eb (diff) | |
download | nextcloud-server-9d86a0444daaa6b98fa9013c42609a6d1b042173.tar.gz nextcloud-server-9d86a0444daaa6b98fa9013c42609a6d1b042173.zip |
Improve share logic for enforced password & expiry date
* It's possible for the admin to enforce and expiry date after, some
shares have been created. This commit makes possible to update the
share with the new admin constraints.
* This commit would users to modify enforced expiry to anything within
range and less than the enforced limit in the pre-create dialog for public
shares.
* This commit fixes, unable to update share without updating password.
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'apps/files_sharing/src/mixins/SharesMixin.js')
-rw-r--r-- | apps/files_sharing/src/mixins/SharesMixin.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 860d1716fe0..41bdf302f7a 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -132,6 +132,9 @@ export default { const shareType = this.share.shareType ?? this.share.type return [this.SHARE_TYPES.SHARE_TYPE_LINK, this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(shareType) }, + isRemoteShare() { + return this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP || this.share.type === this.SHARE_TYPES.SHARE_TYPE_REMOTE + }, isShareOwner() { return this.share && this.share.owner === getCurrentUser().uid }, @@ -152,6 +155,19 @@ export default { ] return !bundledPermissions.includes(this.share.permissions) }, + maxExpirationDateEnforced() { + if (this.isExpiryDateEnforced) { + if (this.isPublicShare) { + return this.config.defaultExpirationDate + } + if (this.isRemoteShare) { + return this.config.defaultRemoteExpirationDateString + } + // If it get's here then it must be an internal share + return this.config.defaultInternalExpirationDate + } + return null + }, }, methods: { |