-
Notifications
You must be signed in to change notification settings - Fork 37
[BUIDL Audition Onchain] SC-009: Build Comprehensive Role-Based Access Control System #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
kindly review @CollinsC1O |
|
Hi Boss,
this is just an example showing my idea. Implement it to flow with your current implementation incase I mixed anything.
This is just an example you could make it flow with your logic
|
|
Hey man @No-bodyq Gm Gm |
Closes: #73
This PR introduces a comprehensive Role-Based Access Control (RBAC) system with full support for dynamic roles, delegation, expiration, auditing, and enforcement modifiers. It includes a complete test suite covering all permission logic and edge cases.
What’s Included
Contracts
AccessControl.cairo– core logic and persistent role storageRBACComponent.cairo– embeddable role-checking modifiersRole Hierarchy
OWNER > ADMIN > SESSION_CREATOR > {JUDGE, REVIEWER, ORACLE} > USER
🔧 Role Features
grant_role/revoke_rolegrant_temporary_role(time-limited permissions)delegate_session_role&revoke_session_delegationemergency_override_rolebatch_grant_roles/batch_revoke_roleshas_role,has_session_role,is_role_expiredonly_admin,only_owner,only_role(role), etc.Audit Logging
Every role change creates an on-chain
AuditLogentry (granted, revoked, delegated, expired).Events
Emits events for:
RoleGrantedRoleRevokedSessionRoleDelegatedEmergencyOverrideTest Suite Highlights
Tests cover: