Skip to content

feat: implement RBAC role manager (#178)#457

Merged
Smartdevs17 merged 5 commits into
Smartdevs17:mainfrom
activatedkc:feat/rbac-role-manager-178
May 28, 2026
Merged

feat: implement RBAC role manager (#178)#457
Smartdevs17 merged 5 commits into
Smartdevs17:mainfrom
activatedkc:feat/rbac-role-manager-178

Conversation

@activatedkc
Copy link
Copy Markdown
Contributor

Summary

Implements comprehensive Role-Based Access Control (RBAC) system to close #178.

Changes

Smart Contract:

  • RoleManager contract with initialize, grant_role, revoke_role, has_permission, delegate_permission, revoke_delegation
  • Multisig governance (propose/approve/execute) for sensitive actions
  • Emergency pause capability
  • Role change history tracking
  • 22 passing tests covering all acceptance criteria

Shared Types:

  • Role enum (Admin, Merchant, Subscriber, Auditor)
  • Permission enum (26 granular permissions)
  • RoleChangeEntry struct
  • StorageKey::AccessControl variant

Storage:

  • set_access_control / get_access_control contract address storage

Subscription Integration:

  • require_permission() helper replacing direct admin.require_auth()
  • Permission checks on: create_plan, deactivate_plan, subscribe, cancel_subscription, pause_subscription, resume_subscription

Frontend:

  • Users & Roles tab (grant/revoke roles)
  • Permissions tab (delegate permissions)
  • Audit Log tab (role change history)
  • Delegations tab (active delegations)

Testing

  • 22 tests in access_control contract: initialization, roles, permissions, delegation, multisig, emergency, history, cleanup
  • All tests pass

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@activatedkc Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17
Copy link
Copy Markdown
Owner

merge conflicts

@activatedkc activatedkc force-pushed the feat/rbac-role-manager-178 branch from fc566f4 to 5f70c4a Compare May 28, 2026 16:14
@activatedkc
Copy link
Copy Markdown
Contributor Author

Fixed @Smartdevs17

@Smartdevs17 Smartdevs17 merged commit 1752cfc into Smartdevs17:main May 28, 2026
4 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement comprehensive access control with role-based permissions

2 participants