Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Internal Stack Behavior #33

Open
egreer opened this issue Nov 24, 2018 · 0 comments
Open

Update Internal Stack Behavior #33

egreer opened this issue Nov 24, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@egreer
Copy link
Contributor

egreer commented Nov 24, 2018

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'
@egreer egreer added the enhancement New feature or request label Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant