Your question is Database Permissions Live Coding. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Finish two dataclasses that represent permission groups and groups, then complete two methods in a service class that loads the permission groups and checks whether a user has permission for a single operation and database combination, including recursively held groups.