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

allow naming roles #2

Open
nmushegian opened this issue Aug 30, 2016 · 1 comment
Open

allow naming roles #2

nmushegian opened this issue Aug 30, 2016 · 1 comment

Comments

@nmushegian
Copy link
Member

You should be able to name a role (.e.g 0 -> "admin"), then set by name instead of ID

@rainbreak
Copy link
Member

I'm thinking something like this:

mapping(string => uint8) _named_roles;
uint8 _nroles;

// new methods
function setUserRoleName(uint8 role, string name)  // name an existing role
function addUserRole(string name) returns (uint8 role)  // create a new role by name (increments nroles)

// overloaded existing methods
function hasUserRole(address who, string role) returns (bool)
function setUserRole(address who, string role, bool enabled)
function setRoleCapability(string role, address code, bytes4 sig, bool enabled)

Other ideas:

  • force usage of role naming (remove methods using uint8 args)

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

No branches or pull requests

2 participants