Problem
The access_control contract has no exported standalone role-checker utility. Consumers must parse the full ACL structure themselves, leading to duplicated and error-prone role verification logic.
Proposed Solution
Create contracts/cntr/role_checker.rs implementing pub fn has_role(roles: &[(String, String)], address: &str, required_role: &str) -> bool and pub fn get_roles_for_address(roles: &[(String, String)], address: &str) -> Vec<String>. The roles slice is a list of (address, role) pairs. Comparisons are case-sensitive. All implementation must live inside contracts/cntr/.
Acceptance Criteria
Problem
The access_control contract has no exported standalone role-checker utility. Consumers must parse the full ACL structure themselves, leading to duplicated and error-prone role verification logic.
Proposed Solution
Create
contracts/cntr/role_checker.rsimplementingpub fn has_role(roles: &[(String, String)], address: &str, required_role: &str) -> boolandpub fn get_roles_for_address(roles: &[(String, String)], address: &str) -> Vec<String>. Therolesslice is a list of(address, role)pairs. Comparisons are case-sensitive. All implementation must live insidecontracts/cntr/.Acceptance Criteria
contracts/cntr/role_checker.rshas_rolereturnsfalsefor an emptyrolesslicehas_roleuses case-sensitive comparison for both address and roleget_roles_for_addressreturns all roles held by an address (a member can hold multiple roles)get_roles_for_addressreturns an emptyVecfor unknown addressescargo test