Skip to content

Comments

FLPATH-3235 | [Bug] Cost management sidebar nav visible to users without cost management RBAC permissions#2335

Open
asmasarw wants to merge 2 commits intoredhat-developer:mainfrom
asmasarw:fix/rbac-sidebar
Open

FLPATH-3235 | [Bug] Cost management sidebar nav visible to users without cost management RBAC permissions#2335
asmasarw wants to merge 2 commits intoredhat-developer:mainfrom
asmasarw:fix/rbac-sidebar

Conversation

@asmasarw
Copy link
Contributor

FLPATH-3235 | [Bug] Cost management sidebar nav visible to users without cost management RBAC permissions

Added Cost Management Guard that performs the following:

  1. If OpenShift has access - OpenShift Menu will appear and Route will be accessible, otherwise it will be hidden from Sidebar and Route will not be accessible.
  2. If Optimizations has access - Optimization Menu will appear and Route will be accessible, otherwise it will be hidden from Sidebar and Route will not be accessible.

Attached All Cases (Has Full Access, Access Only for OpenShift, Access for Only Optimizations, No Access at all)

NO ACCESS FOR BOTH ROUTES

image

ACCESS ONLY FOR OPENSHIFT

image

ACCESS ONLY FOR OPTIMIZATIONS

image

ACCESS FOR ALL

image

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Feb 16, 2026

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/plugin-redhat-resource-optimization

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/redhat-resource-optimization/packages/app none v0.0.5
@red-hat-developer-hub/plugin-redhat-resource-optimization workspaces/redhat-resource-optimization/plugins/redhat-resource-optimization none v2.0.1

@sonarqubecloud
Copy link

Copy link
Contributor

@PreetiW PreetiW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have asked a UX question around this PR here https://redhat-internal.slack.com/archives/C06JYPH9RPA/p1771334321817169 , once we get input will move forward with the review based on the same. 🙌🏻

Copy link
Contributor

@PreetiW PreetiW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asmasarw In this PR we are doing Multiple calls to useResourceOptimizationAccess() (lines 29, 53, 96) cause 6 redundant API requests. Wrap Router with Context Provider to call once and share results. What do you think?
rest of the code looks good to me 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants