diff options
author | nfebe <fenn25.fn@gmail.com> | 2024-11-11 16:31:25 +0100 |
---|---|---|
committer | nfebe <fenn25.fn@gmail.com> | 2024-11-11 16:31:28 +0100 |
commit | c84e30d36af7bcc2c72a21e4ddca969de75941b1 (patch) | |
tree | 4d61a4ddaea7929362dd5be434ba3c6cdc61f0c1 /apps/settings/src/components/Encryption.vue | |
parent | 016738f5beb49d4531ac1924160261bc4526d974 (diff) | |
download | nextcloud-server-fix/no-issues/add-encryption-available-config.tar.gz nextcloud-server-fix/no-issues/add-encryption-available-config.zip |
feat(config): Add sysadmin level `encription.available` configfix/no-issues/add-encryption-available-config
This is important because a user who has admin permissions who is not a sysadmin
might enable encryption without knowing the full implications, the sysadmin
should be able to prevent this.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Diffstat (limited to 'apps/settings/src/components/Encryption.vue')
-rw-r--r-- | apps/settings/src/components/Encryption.vue | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/apps/settings/src/components/Encryption.vue b/apps/settings/src/components/Encryption.vue index d8dcb5434b0..302cd0f41d2 100644 --- a/apps/settings/src/components/Encryption.vue +++ b/apps/settings/src/components/Encryption.vue @@ -99,6 +99,7 @@ export default { logger.debug('No encryption module loaded or enabled') } return { + encryptionIsAvailable: loadState('settings', 'encryption-available', false), encryptionReady: loadState('settings', 'encryption-ready', false), encryptionEnabled: loadState('settings', 'encryption-enabled', false), externalBackendsEnabled: loadState('settings', 'external-backends-enabled'), @@ -112,12 +113,15 @@ export default { }, methods: { displayWarning() { + if (encryptionIsAvailable) { + this.encryptionEnabledToggleEffect() + showError(t('settings', 'File encryption is not allowed by system administrator.')) + logger.debug('File encryption is not allowed by system administrator.') + return + } if (!this.hasEncryptionModules || !this.encryptionReady) { - this.encryptionEnabled = true + this.encryptionEnabledToggleEffect() showError(t('settings', 'Encryption is not ready, please enable an encryption module/app.')) - setTimeout(() => { - this.encryptionEnabled = false - }, 1000) return } if (!this.encryptionEnabled) { @@ -127,6 +131,12 @@ export default { this.shouldDisplayWarning = false } }, + encryptionEnabledToggleEffect() { + this.encryptionEnabled = true + setTimeout(() => { + this.encryptionEnabled = false + }, 1000) + }, async update(key, value) { await confirmPassword() |