I'm trying, by using OpenZeppelin's contracts, to develop a simple DAO (Decentralized Autonomous Organization) with a simple ranking system.
I want to implement two functions that allow users to respectively promote or demote others inside their respective organization if they have an higher rank.
Basically higher ranks shall be allowed to promote a lower rank user by removing its lowest rank and assigning it an higher one.
The actual structure of AccessControl is fine, it's actually smart to have adminRoles for each role.
Let's say I have 4 ranks: A, B, C, D.
I've set admin roles so that A is the admin role of B, B is the admin role of C and C is the admin role of D, basically by build this hierarchy: A > B > C > D.
How can I manage to make it possible for "A role" to promote or demote (by using grantRole or revokeRole) users that have "D role"?
Given that you might have more experience, I was hoping you could help me, because the only thing I've come up to is to actually modify AccessControl's code to actually have multiple adminRoles, but I'd like to actually not alter your source code but eventually adapt mine.