Instead of using a raw stack with simple push and pops we should assign each entry a GUID so that we can have more controlled revoke behavior for easier mixing of block and ! syntax's.
allow_phi! should return a GUID
disallow_phi! should accept an optional GUID to remove
allow_phi and disallow_phi blocks should track the GUID they create and then revoke that particular access.
This will better support weird mixes like the following, with at least consistent behavior (even if we still don't recommend it):
patient_john = PatientInfo.new
guid = patient_john.allow_phi!('allow1', 'reason) # Stack: 'allow1'
patient_john.disallow_phi do # Stack: 'allow1', 'disallow1'
patient_john.disallow_phi(guid) # Stack: 'disallow1'
guid = patient_john.allow_phi('allow2') # Stack: 'disallow1', 'allow2'
end
patient_john.name # Stack: 'allow2'
Instead of using a raw stack with simple push and pops we should assign each entry a GUID so that we can have more controlled revoke behavior for easier mixing of
blockand!syntax's.allow_phi!should return a GUIDdisallow_phi!should accept an optional GUID to removeallow_phianddisallow_phiblocks should track the GUID they create and then revoke that particular access.This will better support weird mixes like the following, with at least consistent behavior (even if we still don't recommend it):