🔀 Merge pull request #900 from Cereal916/disableConfigurationForNonAdmin

Add config option to disable all UI config features for non admin users.
This commit is contained in:
Alicia Sykes
2022-09-18 20:51:11 +01:00
committed by GitHub
4 changed files with 358 additions and 350 deletions

View File

@@ -107,7 +107,8 @@ const store = new Vuex.Store({
perms.allowWriteToDisk = false;
}
// Disable everything
if (appConfig.disableConfiguration) {
if (appConfig.disableConfiguration
|| (appConfig.disableConfigurationForNonAdmin && !isUserAdmin())) {
perms.allowWriteToDisk = false;
perms.allowSaveLocally = false;
perms.allowViewConfig = false;

View File

@@ -509,6 +509,12 @@
"default": false,
"description": "If set to true, no users will be able to view or edit the config through the UI"
},
"disableConfigurationForNonAdmin": {
"title": "Disable all UI Config for non admin users.",
"type": "boolean",
"default": false,
"description": "If set to true, only admin users will be able to view or edit the config through the UI. disableConfiguration must not be set to true."
},
"allowConfigEdit": {
"title": "Allow Config Editing",
"type": "boolean",