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>
This commit is contained in:
@@ -16,6 +16,7 @@ module.exports = {
|
||||
protocolusessl: false,
|
||||
usecdn: true,
|
||||
allowanonymous: true,
|
||||
allowanonymousedits: false,
|
||||
allowfreeurl: false,
|
||||
defaultpermission: 'editable',
|
||||
dburl: '',
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user