-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: gno role manager contract #1285
Conversation
✅ Deploy Preview for teritori-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for testitori ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…e O(1) insert/remove/lookup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick look. First of all, please change the constants from ALL_CAPS to PascalCase; this is just for idiomatic Go.
Secondly, there are cases where I think maps or slices actually make sense here. Like Role.permissions. When you have small amounts of data, they can be more efficient; I suggest you play with gno test -print-runtime-metrics
.
Finally, if you have a hierarchy of roles you also need a way to reorder them. So I'd suggest you leave this be for now; simply have a sudo-user owner
, and then have roles modifiable by those with the correct meta-roles (role:add
, etc.). (you can also go the full-length, and implement the hierarchy as you were)
Thanks for review, i think i will try to split the pkg in V2 to have the hierarchy_role_manager as an extension of the role_manager, so i can keep a very simple & straight forward version for the basic pkg. 🚀 |
superseded by #1293 feel free to reopen if needed |
No description provided.