Skip to content

Commit

Permalink
🛂 Improvedd access controlls in Store (gchq#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Feb 12, 2022
1 parent d5f0c19 commit eb377d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb377d2

Please sign in to comment.