mirror of
https://github.com/BrenBroZAYT/dashy.git
synced 2026-06-13 16:39:59 +00:00
🛂 Improvedd access controlls in Store (#485)
This commit is contained in:
+6
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user