Public user project roles are not created with new project #1515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes in this pull request
This PR fixes an issue that has been haunting us for a while now: There were
ProjectRole
instances whererole=='Pb'
for public users. These instances shouldn't exist, which led to some views showing UI components users were not supposed to see.The public-user project roles are created during project creation; a
ProjectRole
instance is created for each organization member, whether they are project members or not. This should be fixed now by excluding public users when roles are created.The PR also adds a migration to remove all
ProjectRole
instances from the database whenrole='Pb'
.When should this PR be merged
Soon.
Risks
There's a migration, but it's low risk. Since public-user project roles shouldn't exist in the first place, it's safe to just remove them.
Follow-up actions
None.
Checklist (for reviewing)
General
migration
label if a new migration is added.Functionality
Code
Tests
Security
Documentation