Skip to content

feat: implement permission system with operator management and tests#26

Merged
Pvsaint merged 2 commits intoChain-Library:mainfrom
ussyalfaks:main
Apr 29, 2025
Merged

feat: implement permission system with operator management and tests#26
Pvsaint merged 2 commits intoChain-Library:mainfrom
ussyalfaks:main

Conversation

@ussyalfaks
Copy link
Contributor

@ussyalfaks ussyalfaks commented Apr 29, 2025

🚀 Implement Flexible Permission System for Tokenbound Accounts

close #6

📝 Description

This PR introduces a flexible permission system for tokenbound accounts, enabling:

  • Granular access control via structured permissions
  • Dynamic assignment & revocation of permissions
  • Secure verification checks to restrict unauthorized actions
  • Event emission for tracking permission changes

✅ Acceptance Criteria Met

Criteria Status
Permission system functions correctly
Permissions can be assigned & verified
Unauthorized actions are blocked
Authorized users can modify permissions
Events emitted on permission changes

🛠️ Changes Included

  • Permission Struct: Defines permission levels & rules
  • assign_permission(): Grants permissions to accounts
  • check_permission(): Validates access before execution
  • revoke_permission(): Removes permissions (admin-only)
  • PermissionEvent: Logs changes (grant/revoke/modify)

🧪 Testing

  1. Ran scarb buildsuccess
  2. Manual tests:
    • Assigned permissions → verified access
    • Attempted restricted actions → correctly blocked
    • Modified permissions → changes reflected & events emitted

📌 Notes

  • Starred the repo ✅

@Pvsaint
Copy link
Contributor

Pvsaint commented Apr 29, 2025

@ussyalfaks one of the check is failing after 9sec

@Pvsaint Pvsaint merged commit f028d2b into Chain-Library:main Apr 29, 2025
2 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.

[SC] Develop Account Permission System

2 participants