Closed eunices closed 3 years ago
@nwoodward Hi! Even though I've closed this issue, any comments about the post above would be helpful. Thank you!
@eunices Hey! The reason that this code for creating a list of users traverses the dataverse/dataset tree has to do with how we have set up our Dataverse instance. In our case, each top-level dataverse belongs to a different institution. So in order to keep the user lists separate the code iterates recursively down the dataverse tree using the metadata from each dataset to create a users list for each institution. One ancillary benefit of this approach, even in the case of Dataverse instances that aren't federated like ours, is that the lists are of active users.
The list users API endpoint that you referenced (api/admin/list-users/
) is also useful for creating a list of users, regardless if they have ever created a dataverse/dataset or not. The main issue we had with it is that the affiliation field is plain text and not tied to another database table. So people enter different values for the same institution, and we had a hard time grouping them together in any meaningful way.
Does this make sense? Let me know if I'm missing the point of your questions or if I can explain things further.
@nwoodward Thank you for your explanation, it's very clear. :)
Hi! Not sure if this is the right avenue to ask, but can I check why recursion was used in the code?
e.g.,
load_users_recursive
load_user_dataverse
I'm running the python program hitting the api of a local dataverse instance. I have 3 users registered but the report indicates 1 user, and am having some trouble understanding why this might be so.
I'm only running the
users.csv
report forrun.py
But the log outputs Dataverse related things as well
users.csv:
GET
http://localhost:8080/api/admin/list-users/?key=<key>&unblock-key=<key2>&selectedPage=1
Hope to understand
user.csv
to go into the DataversesThanks