navbar admin dash access for all roles that need it#193
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR migrates admin UI access control from role-based to permission-based logic. A new ChangesAdmin UI permissions migration
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/iris/src/utils/admin-access.ts`:
- Around line 1-27: The new ADMIN_UI_PERMISSIONS constant and canAccessAdminUi
function duplicate existing permission logic; remove them and fold their
behaviour into the existing permission abstraction by extending the
hook/use-has-permission.ts (or the existing guard components) so callers can
check admin-ui access via the central API instead of a separate helper.
Specifically: move ADMIN_UI_PERMISSIONS into the permission module and add a
helper or overload in useHasPermission (or export a hasAnyPermission variant)
that accepts this permission list and respects wildcard '*' checks, update any
components that call canAccessAdminUi to use the extended
useHasPermission/guard, and delete the canAccessAdminUi helper to avoid parallel
logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1f73726d-6512-44b2-8ae5-70053342a7eb
📒 Files selected for processing (3)
apps/iris/src/components/navbar.tsxapps/iris/src/routes/_private/admin/route.tsxapps/iris/src/utils/admin-access.ts
Summary by CodeRabbit