-
Notifications
You must be signed in to change notification settings - Fork 22
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
Script Hooks: assign custom permission to the proxy app #143
Comments
Just wondering, is it not possible to do this at the moment? Or do we not have good utilities to make this easy? |
ProposalExpose a hook called hooks: {
setPermissions: async function ( { setPermission }, bre) {
await setPermission("INCREMENT_ROLE", anotherAppInstance.address)
await setPermission("DECREMENT_ROLE", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
// Possible keyword shortcuts
await setPermission("ANOTHER_ROLE", "me")
await setPermission("ANOTHER_ROLE", "rootAccount")
await setPermission("ANOTHER_ROLE", "any")
await setPermission("ANOTHER_ROLE", "anyEntity")
}
} |
At this moment we assign all permission open for the proxy app. Then you can customize it on the client but not from the script. @dapplion I like that approach. In my opinion just allowing |
When in the hooks lifecycle would this happen? I'm primarily curious if this hook would work for setting permissions in any other apps installed rather than only scoped to the current app. We should also default to the normal behaviour if this hook is not defined (and probably log that we're defaulting the behaviour?).
We may want to be careful about just using a string, but almost all apps should be exposing these as getters and so we could do an
I like these! Depending on how we've communicated, I would use only one of However, I wonder if it'd be nicer to use an object mapping for the set of allowed values, so it's easier for the person to know if they're using a correct value. E.g. we've previously made a proxy for error mappings and could do something similar here that will throw if an incorrect value was attempted. |
🚀 Feature
The text was updated successfully, but these errors were encountered: