AccessManager: multiple roles for the same function

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!

i believe i fixed it my self.

i turned my roles into "actions". I created a ACTION_HIRE role and the Position struct element uint64 role became a uint64[] actions element. Now a Position can have multiple action roles.

Now I can create an EXECUTIVE Position who can call hire and terminate and a DIRECTOR Position who can also call hire but can't call terminate for instance.