Build a policy engine with a few lines of recursive SQL: permission graphs and reachability, maintained incrementally.