Revamped Access Control#2112
Conversation
frangio
left a comment
There was a problem hiding this comment.
Lovely test suite! Great work.
20e2d2b to
ac965e7
Compare
|
I commented out the tests for I manually changed the version on the package.json to make the semver check pass and verified that the tests indeed pass. |
1f3fcda to
71f8da2
Compare
|
Going through previous comments I found that the issue with using I've been trying to think of alternatives anyway and actually revoked might be the best one. |
|
I understood your previous comment as meaning that the third event argument would make |
This PR removes
Rolesand introducesAccessControl, its replacement. We will need to update theaccessmini readme andaccess controlguides in a later PR.Fixes #1772. Fixes #1602. Part of #2086. See this discussion on the forum for more context.
We're removing
Rolesto do away with the boilerplate associated with creating new roles, as well as the overhead introduced by the manyexternalfunctions added by each. To achieve this purpose, roles are now referred to by a unique ID, and all functions are parametrized by this identifier.We're also changing some of the rules regarding how roles are granted and revoked:
internalfunctionAccessControlonly add anexternal puregetter for each newly defined roleNote that this does not separate
grantandrevokeconcerns: a role’s admin can perform both tasks. I haven’t found scenarios in which this distinction is important.Finally, it should be noted that
AccessControlcan also be easily used as a standalone contract queried by multiple other contracts in a system by inheriting from it, setting up initial roles in a constructor and exposing_setRoleAdminexternally.