-
Notifications
You must be signed in to change notification settings - Fork 18
PHI permission Enhancements #877
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
Conversation
49112df
to
0b6e126
Compare
0b6e126
to
6d5995b
Compare
Confirmed today that the scope of this PR does not include ability to configure which fields are impacted. |
I'll need to hop on this to make sure the SDK will work with this change. |
6d5995b
to
19177b4
Compare
19177b4
to
6e06632
Compare
Codecov Report
@@ Coverage Diff @@
## master #877 +/- ##
==========================================
+ Coverage 90.64% 90.64% +<.01%
==========================================
Files 50 50
Lines 6763 6854 +91
==========================================
+ Hits 6130 6213 +83
- Misses 633 641 +8 |
Questions:
|
|
api/auth/containerauth.py
Outdated
else: | ||
has_access = False | ||
|
||
if method == 'GET' and exec_op is not noop: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the noop
clause for? Usually we'll pass a noop
when we want to see if the user had permission to do something but don't want to actually to follow through with the action yet.
api/auth/containerauth.py
Outdated
|
||
if method == 'GET' and exec_op is not noop: | ||
handler.phi = _get_access(handler.uid, container) > INTEGER_PERMISSIONS['ro-no-phi'] | ||
if not handler.phi: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For organizational purposes we should set the projection and view the query param in the handler logic. Then we can just pass a PHI=true/false to this method instead.
result = self.handle_origin(result) | ||
modified_results.append(result) | ||
if self.is_true('phi'): | ||
self.log_user_access(AccessType.view_container, cont_name, result.get('_id')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably want to create a more efficient way to call this with a list. Right now it will recreate the hierarchy from this container up. If this level is acquisitions, it means grabbing the same session-project-group from the db for each acquisition, even when it's the same session-project-group.
|
||
r = as_admin.get('/projects/' + project) | ||
assert r.ok | ||
assert r.json()['files'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, it had to do with some persistence of the validator when the test failed before the moved line that made it difficult to understand the underlying error.
075e5b2
to
17fb182
Compare
I see some tests were added, mind adding a few more to get diff coverage closer to 100%? Looks like some of the missed lines involved PHI permissions, covering those lines are most important. |
api/handlers/containerhandler.py
Outdated
projection.pop('info') | ||
projection = None | ||
# if self.is_true('info'): Seems redundant with new phi functionality | ||
# projection.pop('info') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed
bd74c4b
to
ba7c145
Compare
I need to create an instance tracking this branch for integration testing. |
9d1743e
to
f9244ec
Compare
0664339
to
ab677d5
Compare
f999ae5
to
2e81556
Compare
Was it intentional for phi-access to be a required parameter on group POST? Could we get a summary in PR description where this is to be required, and what the default is where it is not required?
|
|
Also, it may be better to track #991 as it is branched off of this PR and is ready for review. |
400bfa2
to
79cae60
Compare
79cae60
to
af4f116
Compare
af4f116
to
406ac2d
Compare
Closing PR for now as requirements for this enhancement are reworked within the team. |
Fixes #869
Changes Made
phi-access
permission property blacklists phi fields (This is a frontend change)POST
except at group level, defaults to truephi
flag can be used to return PHI fields onget_all
calls* This is to support existing behavior
This PR has not applied PHI permissions to POST and PUT methods on containers
Review Checklist