[BUIDL Audition Onchain] SC-009: Build Comprehensive Role-Based Access Control System#81
[BUIDL Audition Onchain] SC-009: Build Comprehensive Role-Based Access Control System#81No-bodyq wants to merge 1 commit intohackinsync:mainfrom
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: