Skip to content
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

Closed
wants to merge 18 commits into from
Closed

Conversation

MikaelVallenet
Copy link
Collaborator

No description provided.

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for teritori-dapp ready!

Name Link
🔨 Latest commit feeefc8
🔍 Latest deploy log https://app.netlify.com/sites/teritori-dapp/deploys/66f5671102494a0009c623bd
😎 Deploy Preview https://deploy-preview-1285--teritori-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for testitori ready!

Name Link
🔨 Latest commit feeefc8
🔍 Latest deploy log https://app.netlify.com/sites/testitori/deploys/66f56712750b430008a50cfa
😎 Deploy Preview https://deploy-preview-1285--testitori.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@thehowl thehowl left a 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)

gno/p/role_manager/role_manager.gno Show resolved Hide resolved
gno/p/role_manager/role_manager.gno Show resolved Hide resolved
@MikaelVallenet
Copy link
Collaborator Author

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. 🚀

@n0izn0iz
Copy link
Collaborator

n0izn0iz commented Oct 9, 2024

superseded by #1293 feel free to reopen if needed

@n0izn0iz n0izn0iz closed this Oct 9, 2024
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.

3 participants