fix(admin/policies): Viewer role sees read-only Purchasing Policies#877
Conversation
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.
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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:
#purchasing-panelrendered withdisabled=true.#save-purchasing-btnand#reset-purchasing-btnhidden.applyReadOnlySettings(null)at the end ofrenderAutomationSettings.Admin role unchanged. Backend remains the authoritative security boundary (still returns 403 on writes).
Files changed
frontend/src/settings.ts(export + applyapplyReadOnlySettings)frontend/src/riexchange.ts(re-apply after re-render)frontend/src/__tests__/settings-permissions.test.tsTest plan
Closes #870.