# All principals and resources are invented; no server is contacted.
records = {101: {"owner": "alice"}, 102: {"owner": "bob"}}
def may_read(user, record_id, approved_support=False):
    if record_id not in records:
        return False
    if records[record_id]["owner"] == user:
        return True
    return user == "support" and approved_support

cases = [("alice", 101, False, True), ("alice", 102, False, False),
         ("support", 102, False, False), ("support", 102, True, True)]
for user, record, approved, expected in cases:
    actual = may_read(user, record, approved)
    assert actual == expected
    print(user, record, "allow" if actual else "deny")
