diff --git a/.env.cec-euprd b/.env.cec-euprd index 0bcb8e9..a9648bd 100644 --- a/.env.cec-euprd +++ b/.env.cec-euprd @@ -9,7 +9,7 @@ REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_se REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll REACT_APP_SUPERSET_URL=https://superset.cec-euprd.fiskerinc.com REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6 -REACT_APP_ROLE_READ_ONLY=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc +REACT_APP_ROLE_READ_ONLY=ae5123e3-7a6a-4ca9-947b-a0f184f82cbd REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8 REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69 diff --git a/.env.cec-prd b/.env.cec-prd index 54ea7a8..9f9fb70 100644 --- a/.env.cec-prd +++ b/.env.cec-prd @@ -9,7 +9,7 @@ REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_se REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll REACT_APP_SUPERSET_URL=https://superset.cec-prd.fiskerinc.com REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6 -REACT_APP_ROLE_READ_ONLY=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc +REACT_APP_ROLE_READ_ONLY=ae5123e3-7a6a-4ca9-947b-a0f184f82cbd REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8 REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69 diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index df56ca3..f665b6e 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -51,6 +51,7 @@ describe("App", () => { beforeAll(() => { global.URL.createObjectURL = jest.fn(); addSnapshotSerializer(expect); + jest.setTimeout(10000); }, 60000); afterEach(() => { diff --git a/src/components/Layouts/SideMenu.jsx b/src/components/Layouts/SideMenu.jsx index f0d24cf..408cb76 100644 --- a/src/components/Layouts/SideMenu.jsx +++ b/src/components/Layouts/SideMenu.jsx @@ -9,10 +9,10 @@ import HomeIcon from "@material-ui/icons/Home"; import SettingsInputCompositeIcon from "@material-ui/icons/SettingsInputComposite"; import { default as React, useEffect, useState } from "react"; +import { getCustomDashboardSubmenu } from "../../services/customDashboards"; import { hasRole, Permissions } from "../../utils/roles"; import { useUserContext } from "../Contexts/UserContext"; import { ExpandableSideMenuItem, MenuItem } from "./MenuItem"; -import { getCustomDashboardSubmenu } from "../../services/customDashboards" const menuData = [ { @@ -67,7 +67,7 @@ const menuData = [ { label: "Certificate", to: "/tools/certificates/add", - rolesPerProvider: Permissions.FiskerCertificate, + rolesPerProvider: Permissions.FiskerMagnaCertificate, }, { label: "Security.dll", diff --git a/src/components/Manifest/List/index.jsx b/src/components/Manifest/List/index.jsx index eca560c..e41d28f 100644 --- a/src/components/Manifest/List/index.jsx +++ b/src/components/Manifest/List/index.jsx @@ -195,7 +195,7 @@ const MainForm = () => { ), }); } - if (hasRole(groups, Permissions.FiskerRead, providers)) { + if (hasRole(groups, Permissions.FiskerCreate, providers)) { actions.push({ tip: `Update "${row.name} ${row.version}"`, link: `/package-update/${row.id}`, diff --git a/src/utils/roles.js b/src/utils/roles.js index 4875da4..69f1d18 100644 --- a/src/utils/roles.js +++ b/src/utils/roles.js @@ -77,7 +77,7 @@ export const Permissions = { [Providers.MAGNA]: [Roles.MAGNAGROUP], }, FiskerTools: { - [Providers.FISKER]: [Roles.APPROVESUPPLIERS, Roles.CERTIFICATES], + [Providers.FISKER]: [Roles.CERTIFICATES, Roles.CREATE], [Providers.FISKER_QA]: [Roles.MANUFACTURE], [Providers.MAGNA]: [Roles.MAGNAGROUP], }, diff --git a/src/utils/roles.test.js b/src/utils/roles.test.js index 3ed5719..c4198ac 100644 --- a/src/utils/roles.test.js +++ b/src/utils/roles.test.js @@ -56,7 +56,7 @@ describe("Roles Helper", () => { it("Check FiskerTools permission", () => { expect( hasRole([Roles.APPROVESUPPLIERS], Permissions.FiskerTools, [Providers.FISKER]) - ).toEqual(true); + ).toEqual(false); expect( hasRole([Roles.CERTIFICATES], Permissions.FiskerTools, [Providers.FISKER]) ).toEqual(true);