Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

ACL plugin: fix roles inclusion for admin user #32

Closed sept-en closed 1 year ago

sept-en commented 1 year ago

Currently, the admin of the specific role is actually not a member of this role. Therefore, the admin is not able to access the specific methods available for the given role.

mooori commented 1 year ago

That's actually intended behavior :) See the last two bullet points in this comment.

Seems like OpenZeppelin behaves in the same way since they only consider members in hasRole:

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/3dac7bbed7b4c0dbf504180c33e8ed8e350b93eb/contracts/access/AccessControl.sol#L81-L86

mfornet commented 1 year ago

As mentioned, this is the intended behavior, not a bug.