-
Notifications
You must be signed in to change notification settings - Fork 2
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
[DUOS-1815][risk=low] Add update own user properties endpoint #1649
Conversation
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.
Nice work - see comments inline. We're kind of designing this API by PR, sorry we don't have more clearly laid out requirements.
src/main/java/org/broadinstitute/consent/http/service/UserService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/consent/http/service/UserService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/consent/http/resources/UserResource.java
Outdated
Show resolved
Hide resolved
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 need an update to the swagger documentation as well. Have a look at api-docs.yaml
. We've been migrating to describing the body of the api calls in a separate yaml file in resources/assets/paths
. See other comments inline. This is looking good!
src/main/java/org/broadinstitute/consent/http/resources/UserResource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/consent/http/service/UserService.java
Outdated
Show resolved
Hide resolved
src/test/java/org/broadinstitute/consent/http/resources/UserResourceTest.java
Show resolved
Hide resolved
good catch on the swagger! totally forgot about that; just added it |
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.
I left a couple of small comments, but looks good overall! I was able to update my own properties, and I got an error response when attempting to update roles without being an admin
src/test/java/org/broadinstitute/consent/http/resources/UserResourceTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/consent/http/util/InstitutionUtil.java
Outdated
Show resolved
Hide resolved
return !isAdmin && !(fieldName.equals("id") || fieldName.equals("name") || fieldName.equals("signingOfficials")); | ||
|
||
return !isAdmin && !(fieldName.equals("id") | ||
|| fieldName.equals("name") |
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.
Oh, i LOVE this new formatting, it's really clean
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.
LGTM?
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.
Looks good to me!
Partially Addresses
https://broadworkbench.atlassian.net/browse/DUOS-1815
Adds needed
PUT /api/user/
endpoint so non-admin users can update their properties.Frontend component: DataBiosphere/duos-ui#1672
Also fixes bug wherein signing officials are not fully returned for non-admin users; this is necessary for the linked frontend issue, so I thought it was an appropriate place to fix it.
Have you read CONTRIBUTING.md lately? If not, do that first.