aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2024-12-16 15:53:12 -0800
committerChristopher Ng <chrng8@gmail.com>2025-01-15 15:50:43 -0800
commit1a43fc57181f4ee7403a3a26d29a4e47dab96888 (patch)
treef71ce1009f1ed1e58016b87df7de85bf53bdd445 /apps/files_sharing/src
parent0eb39d7b9c92712a8083841c227f92dad3d0c86a (diff)
downloadnextcloud-server-1a43fc57181f4ee7403a3a26d29a4e47dab96888.tar.gz
nextcloud-server-1a43fc57181f4ee7403a3a26d29a4e47dab96888.zip
feat(sharing): Toggle custom tokens setting as admin
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/services/ConfigService.ts10
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue2
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_sharing/src/services/ConfigService.ts b/apps/files_sharing/src/services/ConfigService.ts
index 94db0454428..09fdca13598 100644
--- a/apps/files_sharing/src/services/ConfigService.ts
+++ b/apps/files_sharing/src/services/ConfigService.ts
@@ -34,7 +34,8 @@ type FileSharingCapabilities = {
},
send_mail: boolean,
upload: boolean,
- upload_files_drop: boolean
+ upload_files_drop: boolean,
+ custom_tokens: boolean,
},
resharing: boolean,
user: {
@@ -298,4 +299,11 @@ export default class Config {
return this._capabilities?.password_policy || {}
}
+ /**
+ * Returns true if custom tokens are allowed
+ */
+ get allowCustomTokens(): boolean {
+ return this._capabilities?.files_sharing?.public?.custom_tokens
+ }
+
}
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 4d46ec32796..f50a533eeeb 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -109,7 +109,7 @@
autocomplete="off"
:label="t('files_sharing', 'Share label')"
:value.sync="share.label" />
- <NcInputField v-if="isPublicShare && !isNewShare"
+ <NcInputField v-if="config.allowCustomTokens && isPublicShare && !isNewShare"
autocomplete="off"
:label="t('files_sharing', 'Share link token')"
:helper-text="t('files_sharing', 'Set the public share link token to something easy to remember or generate a new token. It is not recommended to use a guessable token for shares which contain sensitive information.')"