diff options
author | Dario Ernst | 2018-01-20 15:05:05 +0100 |
---|---|---|
committer | Dario Ernst | 2018-01-20 15:14:56 +0100 |
commit | 6ae4b8bf1369bff8cc50325b66db66659d2718a5 (patch) | |
tree | 4043f8d76cff6834229828bf1e008396f134f6cd /lib/config | |
parent | 40d1d757048b1eb51e45d4d29ad987739b478881 (diff) |
Add option to enable `freely` permission in closed instance
Before, closed disallowed guest edits completely, by removing
the `freely` permission. This makes it possible to explicitely bring
back guest-editing, but not guest-note-creation, to closed instances.
Signed-off-by: Dario Ernst <dario@kanojo.de>
Diffstat (limited to '')
-rw-r--r-- | lib/config/default.js | 1 | ||||
-rw-r--r-- | lib/config/environment.js | 1 | ||||
-rw-r--r-- | lib/config/index.js | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/lib/config/default.js b/lib/config/default.js index 40803476..000c154a 100644 --- a/lib/config/default.js +++ b/lib/config/default.js @@ -16,6 +16,7 @@ module.exports = { protocolusessl: false, usecdn: true, allowanonymous: true, + allowanonymousedits: false, allowfreeurl: false, defaultpermission: 'editable', dburl: '', diff --git a/lib/config/environment.js b/lib/config/environment.js index 5a297382..eedd4913 100644 --- a/lib/config/environment.js +++ b/lib/config/environment.js @@ -18,6 +18,7 @@ module.exports = { alloworigin: toArrayConfig(process.env.HMD_ALLOW_ORIGIN), usecdn: toBooleanConfig(process.env.HMD_USECDN), allowanonymous: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS), + allowanonymousedits: toBooleanConfig(process.env.HMD_ALLOW_ANONYMOUS_EDITS), allowfreeurl: toBooleanConfig(process.env.HMD_ALLOW_FREEURL), defaultpermission: process.env.HMD_DEFAULT_PERMISSION, dburl: process.env.HMD_DB_URL, diff --git a/lib/config/index.js b/lib/config/index.js index d44207bf..3d22c3c3 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -49,7 +49,7 @@ if (config.ldap.tlsca) { // Permission config.permission = Permission -if (!config.allowanonymous) { +if (!config.allowanonymous && !config.allowanonymousedits) { delete config.permission.freely } if (!(config.defaultpermission in config.permission)) { |