Skip to content

fix: hide admin lifecycle buttons from non-admin users#3217

Closed
rrbanda wants to merge 1 commit into
redhat-developer:mainfrom
rrbanda:pr/role-aware-buttons
Closed

fix: hide admin lifecycle buttons from non-admin users#3217
rrbanda wants to merge 1 commit into
redhat-developer:mainfrom
rrbanda:pr/role-aware-buttons

Conversation

@rrbanda
Copy link
Copy Markdown
Contributor

@rrbanda rrbanda commented May 21, 2026

Summary

  • Non-admin users now see role-appropriate controls in AgentLifecycleDetail:
    • Draft: "Submit for Review" button (the only mutation they can do)
    • Review: read-only "Awaiting admin approval" info chip
    • Staging/Production/Retired: read-only stage label chip
    • "Rebuild" button hidden (requires admin/Kagenti access)
  • Admins retain full access to all lifecycle transition buttons
  • isAdmin prop added to AgentLifecycleDetailProps and threaded through from ChatView and KagentiAgentsPanel

Part of Epic #3208

Test plan

  • Non-admin user opens a draft agent detail → sees "Submit for Review" button only
  • Non-admin user opens an in-review agent → sees "Awaiting admin approval" chip, no action buttons
  • Admin opens any agent detail → sees full lifecycle transition buttons + Rebuild
  • Admin panel (KagentiAgentsPanel) always shows admin buttons

Non-admin users now see role-appropriate controls in AgentLifecycleDetail:
- Draft stage: "Submit for Review" button (the only mutation they can do)
- Review stage: read-only "Awaiting admin approval" chip
- Other stages: read-only stage label chip
- "Rebuild" button hidden for non-admins (requires admin/Kagenti access)

Admins retain full access to all lifecycle transition buttons.
The isAdmin prop is now passed through from ChatView and the admin
KagentiAgentsPanel.

Part of Epic redhat-developer#3208
@rrbanda rrbanda requested review from a team and pkliczewski as code owners May 21, 2026 15:54
@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 21, 2026

Missing Changesets

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

  • @red-hat-developer-hub/backstage-plugin-augment

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

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-augment workspaces/augment/plugins/augment none v0.1.0

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 30.43478% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.41%. Comparing base (7d93262) to head (952c3a6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3217      +/-   ##
==========================================
- Coverage   53.41%   53.41%   -0.01%     
==========================================
  Files        2373     2373              
  Lines       84895    84907      +12     
  Branches    23568    23580      +12     
==========================================
+ Hits        45349    45351       +2     
+ Misses      39200    38009    -1191     
- Partials      346     1547    +1201     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from 7d93262
ai-integrations 70.03% <ø> (ø) Carriedforward from 7d93262
app-defaults 69.60% <ø> (ø) Carriedforward from 7d93262
augment 46.67% <30.43%> (-0.02%) ⬇️
bulk-import 72.86% <ø> (ø) Carriedforward from 7d93262
cost-management 16.49% <ø> (ø) Carriedforward from 7d93262
dcm 32.85% <ø> (ø) Carriedforward from 7d93262
extensions 61.79% <ø> (ø) Carriedforward from 7d93262
global-floating-action-button 74.30% <ø> (ø) Carriedforward from 7d93262
global-header 61.68% <ø> (ø) Carriedforward from 7d93262
homepage 50.92% <ø> (ø) Carriedforward from 7d93262
konflux 91.01% <ø> (ø) Carriedforward from 7d93262
lightspeed 68.33% <ø> (ø) Carriedforward from 7d93262
mcp-integrations 81.59% <ø> (ø) Carriedforward from 7d93262
orchestrator 36.36% <ø> (ø) Carriedforward from 7d93262
quickstart 62.88% <ø> (ø) Carriedforward from 7d93262
sandbox 79.49% <ø> (ø) Carriedforward from 7d93262
scorecard 83.84% <ø> (ø) Carriedforward from 7d93262
theme 64.54% <ø> (ø) Carriedforward from 7d93262
translations 8.49% <ø> (ø) Carriedforward from 7d93262
x2a 78.59% <ø> (ø) Carriedforward from 7d93262

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d93262...952c3a6. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rrbanda
Copy link
Copy Markdown
Contributor Author

rrbanda commented May 21, 2026

Closing: superseded by Phase 2 (#3223) which consolidates role-aware buttons with rejection UI and auto-redirect.

@rrbanda rrbanda closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant