mirror of https://github.com/Lissy93/dashy.git
🛂 Improvedd access controlls in Store (#485)
This commit is contained in:
parent
d5f0c19fbf
commit
eb377d287e
|
@ -7,6 +7,7 @@ import { componentVisibility } from '@/utils/ConfigHelpers';
|
||||||
import { applyItemId } from '@/utils/SectionHelpers';
|
import { applyItemId } from '@/utils/SectionHelpers';
|
||||||
import filterUserSections from '@/utils/CheckSectionVisibility';
|
import filterUserSections from '@/utils/CheckSectionVisibility';
|
||||||
import { InfoHandler, InfoKeys } from '@/utils/ErrorHandler';
|
import { InfoHandler, InfoKeys } from '@/utils/ErrorHandler';
|
||||||
|
import { isUserAdmin } from '@/utils/Auth';
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
|
@ -76,7 +77,11 @@ const store = new Vuex.Store({
|
||||||
perms.allowSaveLocally = false;
|
perms.allowSaveLocally = false;
|
||||||
}
|
}
|
||||||
// Disable saving changes to disk, only
|
// 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;
|
perms.allowWriteToDisk = false;
|
||||||
}
|
}
|
||||||
// Disable everything
|
// Disable everything
|
||||||
|
|
Loading…
Reference in New Issue