Skip to content

Commit 87afd6b

Browse files
authored
Merge pull request #270 from os2display/feature/remove-access-config
Removed access-config.json fetch from Admin
2 parents a4e3aa2 + 361b86c commit 87afd6b

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
1818
* Added update command.
1919
* Added (Client) online-check to public.
2020
* Updated developer documentation.
21+
* Removed admin/access-config.json fetch
2122
* Aligned with v. 2.5.2.
2223
* Removed themes.
2324

assets/admin/app.jsx

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ function App() {
5555
const [authenticated, setAuthenticated] = useState();
5656
const [config, setConfig] = useState();
5757
const [selectedTenant, setSelectedTenant] = useState();
58-
const [accessConfig, setAccessConfig] = useState();
5958
const [tenants, setTenants] = useState();
6059
const [userName, setUserName] = useState("");
6160
const [userType, setUserType] = useState("");
@@ -66,6 +65,26 @@ function App() {
6665
const [isPublished, setIsPublished] = useState("all");
6766
const [exists, setExists] = useState(null);
6867
const [screenUserLatestRequest, setScreenUserLatestRequest] = useState(null);
68+
const [accessConfig, setAccessConfig] = useState({
69+
campaign: {
70+
roles: ["ROLE_ADMIN"],
71+
},
72+
screen: {
73+
roles: ["ROLE_ADMIN"],
74+
},
75+
settings: {
76+
roles: ["ROLE_ADMIN"],
77+
},
78+
groups: {
79+
roles: ["ROLE_ADMIN"],
80+
},
81+
shared: {
82+
roles: ["ROLE_ADMIN"],
83+
},
84+
users: {
85+
roles: ["ROLE_ADMIN", "ROLE_EXTERNAL_USER_ADMIN"],
86+
},
87+
});
6988

7089
const userStore = {
7190
authenticated: { get: authenticated, set: setAuthenticated },
@@ -150,36 +169,6 @@ function App() {
150169
};
151170
}, []);
152171

153-
useEffect(() => {
154-
fetch("/admin/access-config.json")
155-
.then((response) => response.json())
156-
.then((jsonData) => {
157-
setAccessConfig(jsonData);
158-
})
159-
.catch(() => {
160-
setAccessConfig({
161-
campaign: {
162-
roles: ["ROLE_ADMIN"],
163-
},
164-
screen: {
165-
roles: ["ROLE_ADMIN"],
166-
},
167-
settings: {
168-
roles: ["ROLE_ADMIN"],
169-
},
170-
groups: {
171-
roles: ["ROLE_ADMIN"],
172-
},
173-
shared: {
174-
roles: ["ROLE_ADMIN"],
175-
},
176-
users: {
177-
roles: ["ROLE_ADMIN", "ROLE_EXTERNAL_USER_ADMIN"],
178-
},
179-
});
180-
});
181-
}, []);
182-
183172
useEffect(() => {
184173
i18next.init({
185174
interpolation: { escapeValue: false }, // React already does escaping

0 commit comments

Comments
 (0)