Best Practice for `RolesAuthority`
ryanli-me opened this issue · 4 comments
What is the best practice for using RolesAuthority
?
I've tried inheriting it and using constructor RolesAuthority(_owner, this)
to enable a contract with role based control. However, I also saw examples similar to the RolesAuthority.t.sol
where we set up a RoleAuthority
and pass it to a contract that inherits only Auth
.
you don't inherit roles authority, u deploy it separately and set it as the authority
for a contract that inherits from Auth
see https://github.com/dapphub/ds-roles for more background on this pattern
thanks for explaining! i thought so too. curious why is RoleAuthority
inheriting Auth
in addition to Authority
. seems all it needs is a canCall
. because it inherits Auth
makes inheriting RoleAuthority
actually workable?
you're correct it doesn't have to inherit Auth
specifically but it needs some form of access control to determine who can set roles n such
could use Owned
instead for example but Auth
is more flexible
makes sense. thanks!