File tree Expand file tree Collapse file tree 3 files changed +18
-28
lines changed
Expand file tree Collapse file tree 3 files changed +18
-28
lines changed Original file line number Diff line number Diff line change 9797 </NcActionText >
9898 <NcActionInput v-if =" pendingExpirationDate"
9999 class =" share-link-expire-date"
100- :disabled =" saving"
100+ :disabled =" saving || isExpiryDateEnforced "
101101 :is-native-picker =" true"
102102 :hide-label =" true"
103103 :value =" new Date(share.expireDate)"
@@ -302,34 +302,12 @@ export default {
302302 }
303303 return null
304304 },
305-
306- /**
307- * Does the current share have an expiration date
308- *
309- * @return {boolean}
310- */
311- hasExpirationDate: {
312- get () {
313- return this .config .isDefaultExpireDateEnforced
314- || !! this .share .expireDate
315- },
316- set (enabled ) {
317- const defaultExpirationDate = this .config .defaultExpirationDate
318- || new Date (new Date ().setDate (new Date ().getDate () + 1 ))
319- this .share .expireDate = enabled
320- ? this .formatDateToString (defaultExpirationDate)
321- : ' '
322- console .debug (' Expiration date status' , enabled, this .share .expireDate )
323- },
324- },
325-
326305 dateMaxEnforced () {
327306 if (this .config .isDefaultExpireDateEnforced ) {
328307 return new Date (new Date ().setDate (new Date ().getDate () + this .config .defaultExpireDate ))
329308 }
330309 return null
331310 },
332-
333311 /**
334312 * Is the current share password protected ?
335313 *
Original file line number Diff line number Diff line change @@ -135,6 +135,15 @@ export default {
135135 isShareOwner ( ) {
136136 return this . share && this . share . owner === getCurrentUser ( ) . uid
137137 } ,
138+ isExpiryDateEnforced ( ) {
139+ if ( this . isPublicShare ) {
140+ return this . config . isDefaultExpireDateEnforced
141+ }
142+ if ( this . isRemoteShare ) {
143+ return this . config . isDefaultRemoteExpireDateEnforced || this . config . isDefaultExpireDateEnforced
144+ }
145+ return this . config . isDefaultInternalExpireDateEnforced || this . config . isDefaultExpireDateEnforced
146+ } ,
138147 hasCustomPermissions ( ) {
139148 const bundledPermissions = [
140149 BUNDLED_PERMISSIONS . ALL ,
Original file line number Diff line number Diff line change @@ -368,7 +368,13 @@ export default {
368368 */
369369 hasExpirationDate: {
370370 get () {
371- return !! this .share .expireDate || this .config .isDefaultInternalExpireDateEnforced
371+ if (this .isPublicShare ) {
372+ return !! this .share .expireDate || this .config .isDefaultExpireDateEnforced
373+ }
374+ if (this .isRemoteShare ) {
375+ return !! this .share .expireDate || this .config .isDefaultInternalExpireDateEnforced || this .config .isDefaultExpireDateEnforced
376+ }
377+ return !! this .share .expireDate || this .config .isDefaultInternalExpireDateEnforced || this .config .isDefaultExpireDateEnforced
372378 },
373379 set (enabled ) {
374380 this .share .expireDate = enabled
@@ -401,7 +407,7 @@ export default {
401407 return this .fileInfo .type === ' dir'
402408 },
403409 dateMaxEnforced () {
404- if (! this .isRemote && this .config .isDefaultInternalExpireDateEnforced ) {
410+ if (! this .isRemoteShare && this .config .isDefaultInternalExpireDateEnforced ) {
405411 return new Date (new Date ().setDate (new Date ().getDate () + 1 + this .config .defaultInternalExpireDate ))
406412 } else if (this .config .isDefaultRemoteExpireDateEnforced ) {
407413 return new Date (new Date ().setDate (new Date ().getDate () + 1 + this .config .defaultRemoteExpireDate ))
@@ -430,9 +436,6 @@ export default {
430436 isPasswordEnforced () {
431437 return this .isPublicShare && this .config .enforcePasswordForPublicLink
432438 },
433- isExpiryDateEnforced () {
434- return this .config .isDefaultInternalExpireDateEnforced
435- },
436439 defaultExpiryDate () {
437440 if ((this .isGroupShare || this .isUserShare ) && this .config .isDefaultInternalExpireDateEnabled ) {
438441 return new Date (this .config .defaultInternalExpirationDate )
You can’t perform that action at this time.
0 commit comments