Commit 933b7d4
committed
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.1 parent 6bcfcf1 commit 933b7d4
2 files changed
+51
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
376 | 377 | | |
377 | 378 | | |
378 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
379 | 389 | | |
380 | 390 | | |
381 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
24 | 40 | | |
25 | 41 | | |
26 | 42 | | |
| |||
41 | 57 | | |
42 | 58 | | |
43 | 59 | | |
44 | | - | |
45 | | - | |
| 60 | + | |
| 61 | + | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
49 | | - | |
| 65 | + | |
50 | 66 | | |
51 | 67 | | |
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
56 | 94 | | |
57 | 95 | | |
58 | 96 | | |
| |||
0 commit comments