by hmottestad · 8y ago · 0 comments
Problem:
A tree of resources that you can get granted access rights to. When you get access to a node in the tree, you inherit rights to children transitivley. You can also have rights explicitly blocked. The ordering is important. An example, you start of as head of IT and have all the IT stuff granted, but explicitly no access to the IT security department. Then you make CEO and are granted right to everything, so that should overrule your previous restriction for the IT security department.
I think the correct answer is "IT Security should be a peer of IT, not a subdepartment."
For example: how do you store the explicit blocks? More specifically, how do you articulate that head of IT is blocked from this subtree, but the CEO isn't? Some options:
- store the block as pairwise (individual, subtree)
- same idea, but instead of blocks you store explicit /allowances/ (and allow a tree node to have a flag set of "ignore the tree-based permission system here, and just lock everyone out who doesn't have an explicit permission")
- instead of blocking individuals, you could add an abstraction layer, e.g. user_groups, and assign permissions to /groups/.. You could also add an abstraction layer on top of the treenodes themselves (object_permission_groups?). Different tradeoffs with these options.
Again, hard to know exactly where your interviewer was trying to steer the conversation. But that'd be my guess!
It seems like a trick question designed to see if the candidate is willing to question assumptions.
One potential that springs to mind is (say) governance or oversight considerations of the given situation?
Not sure how that'd apply directly either though. Feels like there's more info needed from the interviewer first, to give a hint as to the direction. :)