feat: common roles component#161
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
=======================================
Coverage ? 94.69%
=======================================
Files ? 57
Lines ? 3993
Branches ? 0
=======================================
Hits ? 3781
Misses ? 212
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
d228675 to
df25010
Compare
|
Consider a security agent here |
|
Consider adding some documentation here |
|
single word |
|
consider remove this function and comine them to a single function that got ROLE as arg |
|
very nice! |
RoeeGross
left a comment
There was a problem hiding this comment.
@RoeeGross reviewed 18 files and all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on remollemo).
remollemo
left a comment
There was a problem hiding this comment.
@remollemo made 6 comments.
Reviewable status: 10 of 18 files reviewed, 4 unresolved discussions (waiting on RoeeGross).
packages/utils/src/components/blocklist/blocklist.cairo line 47 at r2 (raw file):
Previously, RoeeGross wrote…
Consider a security agent here
security governor, but this is not for this PR
packages/utils/src/components/common_roles/common_roles.cairo line 17 at r2 (raw file):
Previously, RoeeGross wrote…
Consider adding some documentation here
Done.
packages/utils/src/components/common_roles/common_roles.cairo line 85 at r2 (raw file):
Previously, RoeeGross wrote…
single word
Done.
packages/utils/src/components/common_roles/common_roles.cairo line 127 at r2 (raw file):
Previously, RoeeGross wrote…
consider remove this function and comine them to a single function that got ROLE as arg
I don't understand
RoeeGross
left a comment
There was a problem hiding this comment.
@RoeeGross reviewed 8 files and all commit messages, and resolved 4 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on remollemo).

Note
High Risk
High risk because it refactors core authorization/role-management paths (grant/revoke/renounce, guards, and legacy role reclaim) and rewires multiple security- and upgrade-gated components to depend on the new role layer.
Overview
Introduces
CommonRolesComponent, a new minimal role-management layer (ICommonRoles,Roleenum serialization, role-admin hierarchy setup, guard helpers, and legacy role reclaim/disable flows) backed by OZAccessControl.Refactors
RolesComponentto delegate role state/guards toCommonRolesComponent, adds category-scoped ABIs (IGovernanceRoles,ISecurityRoles,IAppRoles), and tightens non-renounceable role behavior by consolidating errors intoAccessErrors::ROLE_CANNOT_BE_RENOUNCED.Updates Tier-A components (
blocklist,pausable,replaceability) and associated mocks/tests to authorize viaCommonRolesComponent(including switching replaceability tests fromIRolestoICommonRoles).Written by Cursor Bugbot for commit 80181c3. This will update automatically on new commits. Configure here.
This change is