Comments (4)
Proposal
Expose a hook called setPermissions
which allows the user to customize the permission setting. The API could be similar to the app installer where a custom utility function is passed as an argument to minimize code. For example:
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")
}
}
from buidler-aragon.
Just wondering, is it not possible to do this at the moment? Or do we not have good utilities to make this easy?
from buidler-aragon.
is it not possible to do this at the moment?
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 any
, anyEntity
keyword. And otherwise an entity address.
from buidler-aragon.
Expose a hook called
setPermissions
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?).
await setPermission("INCREMENT_ROLE", anotherAppInstance.address)
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 eth_call
to see what the return is, and, failing that, use the hash (and warn that we couldn't find it on the app!)
// Possible keyword shortcuts
I like these! Depending on how we've communicated, I would use only one of me
or rootAccount
. Technically you can still get these values from the BRE, right?
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.
from buidler-aragon.
Related Issues (20)
- More powerful script hooks
- Nice to have features after v0.2.0 HOT 1
- Publish: check and clean `dist/` dir if already pre-populated or dirty
- Add .npmignore file
- Publish: add ability to generate artifact.json by itself
- Publish: use locally available `artifact.json` rather than rebuilding
- App Installer: support install apps from node_modules
- Have a new buidler plugin to extract information from build files HOT 1
- Publish: update parser to @solidity-parser/parser HOT 2
- publish command does not publish correctly HOT 3
- App name is missing HOT 2
- Error when running buidler-aragon on local HOT 8
- Running buidler with a local aragon/aragon already running HOT 4
- Suggest --no-browser option when port 3000 is in use HOT 1
- Avoid building client locally
- ExperimentalAppInstaller. External apps installed from "open.aragonpm.eth" don't show IPFS content. HOT 1
- Impossible to set permission with ACL within buidler-hooks.js HOT 1
- Consider using BuidlerPluginError instead of plain errors HOT 1
- Hardhat support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buidler-aragon.