diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-11-13 15:43:11 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 14:33:13 +0100 |
commit | 444c9b6744f00a0fb8ac31cf0c827c150719bc68 (patch) | |
tree | b4f283ae7a6f7996dc279cc5eabb173c9cc2bad9 /apps/files_sharing/src/services | |
parent | efce1fdfaca81353414c2a752dcebfa3ca4135e6 (diff) | |
download | nextcloud-server-444c9b6744f00a0fb8ac31cf0c827c150719bc68.tar.gz nextcloud-server-444c9b6744f00a0fb8ac31cf0c827c150719bc68.zip |
Add settings front and split sharing entry config
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/src/services')
-rw-r--r-- | apps/files_sharing/src/services/ConfigService.js | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/apps/files_sharing/src/services/ConfigService.js b/apps/files_sharing/src/services/ConfigService.js index 7058c714776..7e0ae960c64 100644 --- a/apps/files_sharing/src/services/ConfigService.js +++ b/apps/files_sharing/src/services/ConfigService.js @@ -58,7 +58,7 @@ export default class Config { } /** - * Get the default expiration date as string + * Get the default link share expiration date as string * * @returns {string} * @readonly @@ -76,6 +76,24 @@ export default class Config { } /** + * Get the default internal expiration date as string + * + * @returns {string} + * @readonly + * @memberof Config + */ + get defaultInternalExpirationDateString() { + let expireDateString = '' + if (this.isDefaultInternalExpireDateEnabled) { + const date = window.moment.utc() + const expireAfterDays = this.defaultInternalExpireDate + date.add(expireAfterDays, 'days') + expireDateString = date.format('YYYY-MM-DD') + } + return expireDateString + } + + /** * Are link shares password-enforced ? * * @returns {boolean} @@ -120,6 +138,28 @@ export default class Config { } /** + * Is internal shares expiration enforced ? + * + * @returns {boolean} + * @readonly + * @memberof Config + */ + get isDefaultInternalExpireDateEnforced() { + return OC.appConfig.core.defaultInternalExpireDateEnforced === true + } + + /** + * Is there a default expiration date for new internal shares ? + * + * @returns {boolean} + * @readonly + * @memberof Config + */ + get isDefaultInternalExpireDateEnabled() { + return OC.appConfig.core.defaultInternalExpireDateEnabled === true + } + + /** * Are users on this server allowed to send shares to other servers ? * * @returns {boolean} @@ -142,7 +182,7 @@ export default class Config { } /** - * Get the default days to expiration + * Get the default days to link shares expiration * * @returns {int} * @readonly @@ -153,6 +193,17 @@ export default class Config { } /** + * Get the default days to internal shares expiration + * + * @returns {int} + * @readonly + * @memberof Config + */ + get defaultInternalExpireDate() { + return OC.appConfig.core.defaultInternalExpireDate + } + + /** * Is resharing allowed ? * * @returns {boolean} |