Skip to content

feat: implement universal rbac for contracts#52

Merged
Ceejaytech25 merged 1 commit intoceejaylaboratory:mainfrom
Agbasimere:feat-rbac-module
Mar 28, 2026
Merged

feat: implement universal rbac for contracts#52
Ceejaytech25 merged 1 commit intoceejaylaboratory:mainfrom
Agbasimere:feat-rbac-module

Conversation

@Agbasimere
Copy link
Copy Markdown
Contributor

Closes: #25

Description

This PR implements a universal, modular Role-Based Access Control (RBAC) system for Soroban smart contracts. It provides a standard way to manage permissions (Admin, Moderator, Contributor) within the AnchorPoint ecosystem.

Key Changes

  • Modular RBAC Module: Created src/auth/rbac.rs which can be used both as a library crate and as a standalone contract.
  • Hierarchical Permissions:
    • Admin: Full control, can assign/revoke roles.
    • Moderator: Intermediate access level.
    • Contributor: Basic functionality level.
  • Integrated Events: Automated event publication for role assignment and revocation to ensure a transparent audit trail on-chain.
  • Unit testing: Comprehensive test suite covering initial setup, hierarchy validation, and authorization checks.

Integration

The module is designed for easy integration:

  1. As a dependency: Add anchorpoint-auth = { path = "../auth" } to your contract's Cargo.toml.
  2. As a contract: Deploy RBACContract as a centralized permission manager.

Commands

  • Test: cargo test -p anchorpoint-auth

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@Agbasimere 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

@Ceejaytech25
Copy link
Copy Markdown
Contributor

@Agbasimere , lgtm!

@Ceejaytech25 Ceejaytech25 merged commit 44fa61b into ceejaylaboratory:main Mar 28, 2026
1 check 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.

Smart Contract: Role-Based Access Control (RBAC) Module

2 participants