Skip to content

fix(admin/policies): Viewer role sees read-only Purchasing Policies#877

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/870-viewer-admin-policies-readonly
Jun 1, 2026
Merged

fix(admin/policies): Viewer role sees read-only Purchasing Policies#877
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/870-viewer-admin-policies-readonly

Conversation

@cristim
Copy link
Copy Markdown
Member

@cristim cristim commented May 30, 2026

Summary

QA Viewer Role 6.2: Viewer role users could type values into the Admin > Purchasing Policies inputs. Only the Save button rejected with "Failed to save settings: admin access required" -- the UI didn't gate input.

Fix

For non-admin roles:

  • Inputs under #purchasing-panel rendered with disabled=true.
  • #save-purchasing-btn and #reset-purchasing-btn hidden.
  • Dynamically-rendered RI Exchange automation form covered via applyReadOnlySettings(null) at the end of renderAutomationSettings.

Admin role unchanged. Backend remains the authoritative security boundary (still returns 403 on writes).

Files changed

  • frontend/src/settings.ts (export + apply applyReadOnlySettings)
  • frontend/src/riexchange.ts (re-apply after re-render)
  • frontend/src/__tests__/settings-permissions.test.ts

Test plan

  • 8 permission tests pass covering admin, readonly, user, and null cases.
  • 65 test suites pass (2146 tests + 1 skipped).
  • Manual: log in as viewer, open Admin > Purchasing Policies, confirm inputs disabled + Save/Reset hidden.

Closes #870.

Viewer could type values in inputs; only the Save button rejected.
Inputs now read-only and Save/Reset buttons hidden for role=viewer.
Admin role unchanged. RI Exchange dynamically-rendered automation form
is covered via applyReadOnlySettings(null) after re-render.

Closes #870.
@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/this-sprint Within the current sprint impact/few Limited audience effort/xs Trivial / one-liner type/bug Defect labels May 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 50 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f10ce528-2494-4b84-84e1-b63bb5537058

📥 Commits

Reviewing files that changed from the base of the PR and between 4956d66 and c14964e.

📒 Files selected for processing (3)
  • frontend/src/__tests__/settings-permissions.test.ts
  • frontend/src/riexchange.ts
  • frontend/src/settings.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/870-viewer-admin-policies-readonly

Comment @coderabbitai help to get the list of available commands and usage tips.

@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 30, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
Copy link
Copy Markdown
Member Author

cristim commented Jun 1, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim cristim merged commit 5b602d6 into feat/multicloud-web-frontend Jun 1, 2026
5 checks passed
@cristim cristim deleted the fix/870-viewer-admin-policies-readonly branch June 1, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant