-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add router to get limited user information by Orcid ID
This router exposes limited user information (first name, last name, and username/Orcid ID) to non-admin users. Previously, non-admin users could not look up users at all. Non-self user lookup by non-admin users is necessary for adding users to a collection in the UI. Use Starlette custom type convertor to determine whether the provided ID in the router path is an Orcid ID. If so, limited information about the user will be returned, whether or not the requesting user has admin privileges. If the ID in the router path is an integer (database ID), the previously existing router will be used, which requires admin privileges and returns the full admin view of the user. We may choose to combine these routers in the future, in order to only allow user lookup by Orcid ID/username, unless there is a use case for looking up by database ID. Note that the custom type convertor requires an actual Orcid ID, so usernames that are not Orcid IDs cannot be used for user lookup.
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters