🛂 Improvedd access controlls in Store (#485)

This commit is contained in:
Alicia Sykes 2022-02-12 21:23:47 +00:00
parent d5f0c19fbf
commit eb377d287e
1 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import { componentVisibility } from '@/utils/ConfigHelpers';
import { applyItemId } from '@/utils/SectionHelpers';
import filterUserSections from '@/utils/CheckSectionVisibility';
import { InfoHandler, InfoKeys } from '@/utils/ErrorHandler';
import { isUserAdmin } from '@/utils/Auth';
Vue.use(Vuex);
@ -76,7 +77,11 @@ const store = new Vuex.Store({
perms.allowSaveLocally = false;
}
// Disable saving changes to disk, only
if (appConfig.preventWriteToDisk) {
if (appConfig.preventWriteToDisk || !isUserAdmin) {
perms.allowWriteToDisk = false;
}
// Legacy Option: Will be removed in V 2.1.0
if (appConfig.allowConfigEdit === false) {
perms.allowWriteToDisk = false;
}
// Disable everything