diff --git a/portal-ui/src/common/SecureComponent/permissions.ts b/portal-ui/src/common/SecureComponent/permissions.ts index da462145a..9c0ba1cff 100644 --- a/portal-ui/src/common/SecureComponent/permissions.ts +++ b/portal-ui/src/common/SecureComponent/permissions.ts @@ -142,9 +142,9 @@ export const IAM_PAGES = { IDP_OPENID_CONFIGURATIONS_VIEW: "/idp/openid/configurations/:idpName", IDP_OPENID_CONFIGURATIONS_ADD: "/idp/openid/configurations/add-idp", - POLICIES: "/identity/policies", - POLICY_ADD: "/identity/add-policy", - POLICIES_VIEW: "/identity/policies/*", + POLICIES: "/policies", + POLICY_ADD: "/add-policy", + POLICIES_VIEW: "/policies/*", /* Monitoring */ TOOLS_LOGS: "/tools/logs", TOOLS_AUDITLOGS: "/tools/audit-logs", diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx index 6f6f0d808..eaca9ec13 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx @@ -194,7 +194,7 @@ const AccessRule = () => { /> )} - Access Rules + Anonymous Access { }} {{ tabConfig: { - label: "Access Audit", + label: "Access", value: "access", component: Link, disabled: !hasPermission(bucketName, [ @@ -410,7 +410,7 @@ const BucketDetails = ({ classes }: IBucketDetailsProps) => { }} {{ tabConfig: { - label: "Access Rules", + label: "Anonymous", value: "prefix", component: Link, disabled: !hasPermission(bucketName, [ diff --git a/portal-ui/src/screens/Console/valid-routes.ts b/portal-ui/src/screens/Console/valid-routes.ts index 746a0027f..b3fd3070e 100644 --- a/portal-ui/src/screens/Console/valid-routes.ts +++ b/portal-ui/src/screens/Console/valid-routes.ts @@ -119,6 +119,14 @@ export const validRoutes = ( forceDisplay: true, children: [], }, + { + group: "Administrator", + name: "Policies", + component: NavLink, + id: "policies", + to: IAM_PAGES.POLICIES, + icon: AccessMenuIcon, + }, { group: "Administrator", name: "Identity", @@ -145,13 +153,6 @@ export const validRoutes = ( icon: GroupsMenuIcon, fsHidden: ldapIsEnabled, }, - { - name: "Policies", - component: NavLink, - id: "policies", - to: IAM_PAGES.POLICIES, - icon: AccessMenuIcon, - }, { name: "OpenID", component: NavLink, diff --git a/portal-ui/tests/permissions-A/iamPolicies.ts b/portal-ui/tests/permissions-A/iamPolicies.ts index 85bf857cc..27ad523da 100644 --- a/portal-ui/tests/permissions-A/iamPolicies.ts +++ b/portal-ui/tests/permissions-A/iamPolicies.ts @@ -23,6 +23,7 @@ import { identityElement, usersElement, } from "../utils/elements-menu"; +import { IAM_PAGES } from "../../src/common/SecureComponent/permissions"; const iamPolicyListItem = Selector( ".ReactVirtualized__Table__rowColumn" @@ -52,21 +53,21 @@ test("IAM Policies sidebar item exists", async (t) => { test("Create Policy button exists", async (t) => { const createPolicyButtonExists = elements.createPolicyButton.exists; await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .expect(createPolicyButtonExists) .ok(); }); test("Create Policy button is clickable", async (t) => { await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .click(elements.createPolicyButton); }); test("Policy Name input exists in the Create Policy modal", async (t) => { const policyNameInputExists = elements.createPolicyName.exists; await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .click(elements.createPolicyButton) .expect(policyNameInputExists) .ok(); @@ -75,7 +76,7 @@ test("Policy Name input exists in the Create Policy modal", async (t) => { test("Policy textfield exists in the Create Policy modal", async (t) => { const policyTextfieldExists = elements.createPolicyTextfield.exists; await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .click(elements.createPolicyButton) .expect(policyTextfieldExists) .ok(); @@ -83,7 +84,7 @@ test("Policy textfield exists in the Create Policy modal", async (t) => { test("Create Policy modal can be submitted after inputs are entered", async (t) => { await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .click(elements.createPolicyButton) .typeText(elements.createPolicyName, constants.TEST_IAM_POLICY_NAME) .typeText(elements.createPolicyTextfield, constants.TEST_IAM_POLICY, { @@ -94,7 +95,7 @@ test("Create Policy modal can be submitted after inputs are entered", async (t) }).after(async (t) => { // Clean up created policy await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .typeText(elements.searchResourceInput, constants.TEST_IAM_POLICY_NAME) .click(iamPolicyDelete) .click(elements.deleteButton); @@ -103,7 +104,7 @@ test("Create Policy modal can be submitted after inputs are entered", async (t) test("Created Policy can be viewed and deleted", async (t) => { const iamPolicyListItemExists = iamPolicyListItem.exists; await t - .navigateTo("http://localhost:9090/identity/policies") + .navigateTo(`http://localhost:9090${IAM_PAGES.POLICIES}`) .click(elements.createPolicyButton) .typeText(elements.createPolicyName, constants.TEST_IAM_POLICY_NAME) .typeText(elements.createPolicyTextfield, constants.TEST_IAM_POLICY, { diff --git a/portal-ui/tests/utils/elements-menu.ts b/portal-ui/tests/utils/elements-menu.ts index 8e1e8123d..95bd9522e 100644 --- a/portal-ui/tests/utils/elements-menu.ts +++ b/portal-ui/tests/utils/elements-menu.ts @@ -65,9 +65,10 @@ export const groupsElement = identityChildren .find("a") .withAttribute("href", IAM_PAGES.GROUPS); -export const iamPoliciesElement = identityChildren - .find("a") - .withAttribute("href", IAM_PAGES.POLICIES); +export const iamPoliciesElement = sidebarItem.withAttribute( + "href", + IAM_PAGES.POLICIES +); export const configurationsElement = Selector(".MuiPaper-root") .find("ul") diff --git a/portal-ui/tests/utils/elements.ts b/portal-ui/tests/utils/elements.ts index 3506f3fa1..dae614b6b 100644 --- a/portal-ui/tests/utils/elements.ts +++ b/portal-ui/tests/utils/elements.ts @@ -151,7 +151,7 @@ export const createGroupUserTable = Selector( // Bucket page vertical tabs //---------------------------------------------------- export const bucketAccessRulesTab = - Selector(".MuiTab-root").withText("Access Rules"); + Selector(".MuiTab-root").withText("Anonymous"); //---------------------------------------------------- // Settings window