From 9d86a0444daaa6b98fa9013c42609a6d1b042173 Mon Sep 17 00:00:00 2001
From: fenn-cs <fenn25.fn@gmail.com>
Date: Wed, 29 Nov 2023 15:06:51 +0100
Subject: 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>
---
 apps/files_sharing/src/components/SharingEntryLink.vue | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

(limited to 'apps/files_sharing/src/components/SharingEntryLink.vue')

diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue
index 77caaee0154..d14fc2b6df3 100644
--- a/apps/files_sharing/src/components/SharingEntryLink.vue
+++ b/apps/files_sharing/src/components/SharingEntryLink.vue
@@ -95,13 +95,13 @@
 			</NcActionText>
 			<NcActionInput v-if="pendingExpirationDate"
 				class="share-link-expire-date"
-				:disabled="saving || isExpiryDateEnforced"
+				:disabled="saving"
 				:is-native-picker="true"
 				:hide-label="true"
 				:value="new Date(share.expireDate)"
 				type="date"
 				:min="dateTomorrow"
-				:max="dateMaxEnforced"
+				:max="maxExpirationDateEnforced"
 				@input="onExpirationChange">
 				<!-- let's not submit when picked, the user
 					might want to still edit or copy the password -->
@@ -300,12 +300,6 @@ export default {
 			}
 			return null
 		},
-		dateMaxEnforced() {
-			if (this.config.isDefaultExpireDateEnforced) {
-				return new Date(new Date().setDate(new Date().getDate() + this.config.defaultExpireDate))
-			}
-			return null
-		},
 		/**
 		 * Is the current share password protected ?
 		 *
-- 
cgit v1.2.3

