Skip to content
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

Deleting a user does not remove assigned roles #10834

Open
Falco-KUB opened this issue Sep 11, 2024 · 5 comments
Open

Deleting a user does not remove assigned roles #10834

Falco-KUB opened this issue Sep 11, 2024 · 5 comments
Labels
Type: Bug a defect

Comments

@Falco-KUB
Copy link

What steps does it take to reproduce the issue?

  • When does this issue occur?
  1. Assign a role to user within a Dataverse Collection.
  2. Delete the user.
  3. Try to create a new subcollection.
    while :InheritParentRoleAssignments is true for the parent collection.
  • Which page(s) does it occurs on?
    Create new Dataverse.

  • What happens?
    createDVerror

  • To whom does it occur (all users, curators, superusers)?
    Anyone with the permission to create a new Dataverse Collection.

  • What did you expect to happen?
    Deleting a user should properly remove all assigned roles (or at least give a warning).
    The assigned role was only visible through the API, and not in the UI.
    Removing the assigned role manually via API fixed the error.

Which version of Dataverse are you using?
6.1

Any related open or closed issues to this bug report?

Screenshots:

No matter the issue, screenshots are always welcome.

To add a screenshot, please use one of the following formats and/or methods described here:

Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?

@Falco-KUB Falco-KUB added the Type: Bug a defect label Sep 11, 2024
@qqmyers
Copy link
Member

qqmyers commented Sep 11, 2024

How are you deleting a user? (The API should be checking for role assignments and returning a Bad Request error if there are any.)

@Asbjoedt
Copy link

Asbjoedt commented Sep 12, 2024

Hi!

I deleted the user in the database, and here you get prompted to delete all foreign key constraints in other tables before you can delete the user. So that was the method.

I did so, because I thought there was no API for deleting users however, after rereading there indeed is under certain conditions, according to documentation:

Note: If the user has performed certain actions such as creating or contributing to a Dataset or downloading a file they cannot be deleted.

There's also this in the documentation:

Note: A primary purpose of most Dataverse installations is to serve an archive. In the archival space, there are best practices around the tracking of data access and the tracking of modifications to data and metadata. In support of these key workflows, a simple mechanism to delete users that have performed edit or access actions in the system is not provided. Providing a Deactivate User endpoint for users who have taken certain actions in the system alongside a Delete User endpoint to remove users that haven’t taken certain actions in the system is by design.

To be honest I didn't first try the delete user API endpoint. Also, for our specific use case I think we should just haver merged the accounts, because it was a case of same user as both local user and a Shibboleth auth user.

This one is on me I think, guys. Sorry!

@pdurbin
Copy link
Member

pdurbin commented Sep 12, 2024

Ah, yes, in this case it sounds like merging would have worked.

I dunno, deleting users from the database is not recommended. Maybe we can close this issue, now that we understand better what happened?

@Falco-KUB
Copy link
Author

Sure, sorry for the disturbance.

@qqmyers
Copy link
Member

qqmyers commented Sep 12, 2024

FWIW - I found that roleassignment table odd as well - the one place we refer to a user that doesn't use a foreign key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug a defect
Projects
None yet
Development

No branches or pull requests

4 participants