Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[user_accounts] Prevent crash when one user has no site/project affiliations #8139

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

ridz1208
Copy link
Collaborator

Brief summary of changes

Although this usecase should never happen as it is prevented by rules in the edit_user logic, a couple bugs have let it happen in the pass and the entire module becomes inaccessible. This makes the module load and displays a message in the user row informing the editor that the user does not currently have any sites and projects.

The only way to test this would be to manually delete all site associations directly in the DB user_psc_rel OR all project associations user_project_rel

Note that the module crashes even if the user not having any sites or projects is not the editor nor the editee... any user can cause this issue

@ridz1208 ridz1208 added this to the 23.0.12 milestone Jul 14, 2022
@ridz1208 ridz1208 added the Critical to release PR or issue is key for the release to which it has been assigned label Jul 14, 2022
@driusan
Copy link
Collaborator

driusan commented Jul 14, 2022

I cherry-picked this onto 24 so I can test it and (after resolving conflicts in UserAccountRowProvisioner), this works for sites. When a user has no project affiliation, the user gets filtered out of the user accounts table because they have no projects in common with the logged in user.

Is this the expected behaviour?

@ridz1208
Copy link
Collaborator Author

@driusan i was not expecting it but it seems to be what happens. I'm not as concerned about it. its better than a crash

@driusan
Copy link
Collaborator

driusan commented Jul 14, 2022

I'm not sure if it's what we want.. I think the users will become orphans with no one able to find them but as you say, it's better than a crash, so I'm approving..

@driusan driusan merged commit 87f29a9 into aces:23.0-release Jul 14, 2022
cmadjar pushed a commit to cmadjar/Loris that referenced this pull request Aug 10, 2022
…ations (aces#8139)

Although this use case should never happen as it is prevented by rules in the edit_user logic, a couple bugs have let it happen in the past and the entire module becomes inaccessible. This makes the module load and displays a message in the user row informing the editor that the user does not currently have any sites and projects.

The only way to test this would be to manually delete all site associations directly in the DB user_psc_rel OR all project associations user_project_rel

Note that the module crashes even if the user not having any sites or projects is not the editor nor the editee... any user can cause this issue.
cmadjar pushed a commit to cmadjar/Loris that referenced this pull request Sep 20, 2022
…ations (aces#8139)

Although this use case should never happen as it is prevented by rules in the edit_user logic, a couple bugs have let it happen in the past and the entire module becomes inaccessible. This makes the module load and displays a message in the user row informing the editor that the user does not currently have any sites and projects.

The only way to test this would be to manually delete all site associations directly in the DB user_psc_rel OR all project associations user_project_rel

Note that the module crashes even if the user not having any sites or projects is not the editor nor the editee... any user can cause this issue.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Critical to release PR or issue is key for the release to which it has been assigned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants