Back to problems

Grant / Revoke / Check Access on Hierarchy

Object-Oriented Programming · Pinterest · Medium

Requirements Build a class that controls advertiser access, or access for another kind of entity, to groups arranged in an unchanging hierarchy. Each group is represented by its hierarchy path, such as planet, region/eu, or district/paris. Access propagates downward: granting an entity region/eu also permits it to access every district beneath region/eu. Therefore, check_access(entity, 'district/paris') must produce true. Notes Store explicit permissions in a Map >, and…

Checking your access…