aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-09-28 12:40:18 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2023-10-02 11:29:04 +0000
commit0537bbd331cda5ad7b477c398e652b4c11c4834d (patch)
tree1f88116401d2f35f04e4aad704ea58fe462010d6 /apps
parenta092bae72008ac0fa6297013ae4ba86a1827fc93 (diff)
downloadnextcloud-server-0537bbd331cda5ad7b477c398e652b4c11c4834d.tar.gz
nextcloud-server-0537bbd331cda5ad7b477c398e652b4c11c4834d.zip
Correct check for enabled expiration date
The default expiration date cannot be enforced if it is not enabled in the first place. Hence, the check for whether a share has an expiration date should not consider enforcements but only where the share expiry type is enabled. For example : Using `this.config.isDefaultExpireDateEnabled` instead of `this.config.isDefaultExpireDateEnforced` which can be verified by checking `isExpiryDateEnforced`. Resolves : https://github.com/nextcloud/server/issues/40612 Signed-off-by: fenn-cs <fenn25.fn@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 79bd05a45bb..ca578794d13 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -380,13 +380,19 @@ export default {
*/
hasExpirationDate: {
get() {
+ const isDefaultExpireDateEnabled = this.config.isDefaultExpireDateEnabled
+ const hasExistingExpirationDate = !!this.share.expireDate || isDefaultExpireDateEnabled
+ const isDefaultInternalExpireDateEnabled = this.config.isDefaultInternalExpireDateEnabled
+ const isDefaultRemoteExpireDateEnabled = this.config.isDefaultRemoteExpireDateEnabled
if (this.isPublicShare) {
- return !!this.share.expireDate || this.config.isDefaultExpireDateEnforced
+ return hasExistingExpirationDate
}
+
if (this.isRemoteShare) {
- return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
+ return hasExistingExpirationDate || isDefaultRemoteExpireDateEnabled
}
- return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
+
+ return hasExistingExpirationDate || isDefaultInternalExpireDateEnabled
},
set(enabled) {
this.share.expireDate = enabled