Hi guys!
I was just wondering if AccessManager can allow multiple roles to grant access to a restricted function in an AccessManaged contract.
Scanning through the source it appears that a function can be restricted to a role, but not multiple roles.
I have this kind of setup:
contract: Corp
(is AccessManager
)
contract: HumanResources
(is AccessManaged
)
In HumanResources
i have a hire(address account, uint256 index, uint32 delay)
function which grants an address a specific role by internally resolving index
to a Position
struct which holds the roleId and eventually calls corp.grantRole(role, account, delay)
.
Now, the hire()
function itself is restricted
and shall only be callable by EXECUTIVE
and DIRECTOR
roles.
Im using Foundry with the latest OZ contracts.
Thanks for any suggestion!