diff --git a/CHANGELOG.md b/CHANGELOG.md index 60bd8aba..001c7208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. * Added update command. * Added (Client) online-check to public. * Updated developer documentation. +* Removed admin/access-config.json fetch * Aligned with v. 2.5.2. * Removed themes. diff --git a/assets/admin/app.jsx b/assets/admin/app.jsx index c34c6d70..17b1d21a 100644 --- a/assets/admin/app.jsx +++ b/assets/admin/app.jsx @@ -55,7 +55,6 @@ function App() { const [authenticated, setAuthenticated] = useState(); const [config, setConfig] = useState(); const [selectedTenant, setSelectedTenant] = useState(); - const [accessConfig, setAccessConfig] = useState(); const [tenants, setTenants] = useState(); const [userName, setUserName] = useState(""); const [userType, setUserType] = useState(""); @@ -66,6 +65,26 @@ function App() { const [isPublished, setIsPublished] = useState("all"); const [exists, setExists] = useState(null); const [screenUserLatestRequest, setScreenUserLatestRequest] = useState(null); + const [accessConfig, setAccessConfig] = useState({ + campaign: { + roles: ["ROLE_ADMIN"], + }, + screen: { + roles: ["ROLE_ADMIN"], + }, + settings: { + roles: ["ROLE_ADMIN"], + }, + groups: { + roles: ["ROLE_ADMIN"], + }, + shared: { + roles: ["ROLE_ADMIN"], + }, + users: { + roles: ["ROLE_ADMIN", "ROLE_EXTERNAL_USER_ADMIN"], + }, + }); const userStore = { authenticated: { get: authenticated, set: setAuthenticated }, @@ -150,36 +169,6 @@ function App() { }; }, []); - useEffect(() => { - fetch("/admin/access-config.json") - .then((response) => response.json()) - .then((jsonData) => { - setAccessConfig(jsonData); - }) - .catch(() => { - setAccessConfig({ - campaign: { - roles: ["ROLE_ADMIN"], - }, - screen: { - roles: ["ROLE_ADMIN"], - }, - settings: { - roles: ["ROLE_ADMIN"], - }, - groups: { - roles: ["ROLE_ADMIN"], - }, - shared: { - roles: ["ROLE_ADMIN"], - }, - users: { - roles: ["ROLE_ADMIN", "ROLE_EXTERNAL_USER_ADMIN"], - }, - }); - }); - }, []); - useEffect(() => { i18next.init({ interpolation: { escapeValue: false }, // React already does escaping