Skip to content

Allow all project collaborators to see collaborators list - #544

Open
dnass wants to merge 1 commit into
masterfrom
534-project-collaborators-visibility
Open

dnass wants to merge 1 commit into
masterfrom
534-project-collaborators-visibility

Conversation

@dnass

@dnass dnass commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Closes #534. Gates the project collaborator queryset with a new projects.view_collaborators permission, which is true for all of the project's collaborators and false otherwise.

@duckduckgrayduck

Copy link
Copy Markdown
Contributor

Looks good to me. One non-blocking note: there are now two permissions about viewing collaborators.

  1. projects.view_collaborators (new in this PR)

Checked against a project: user.has_perm("projects.view_collaborators", project)
Answers “can this user see the collaborator list for this project?”
Rule: logged in and on the project (view, edit or admin)

  1. projects.view_collaboration (existing)

Checked against a single collaborator: user.has_perm("projects.view_collaboration", collaboration)
Answers “can this user see this one collaborator?”
Rule (in projects/rules.py): logged in and an admin on that collaborator’s project
Nothing checks it. Django generates the permission name for the Collaboration model, and DRF doesn’t check view permissions on GET.

Since the second one now contradicts the first, it might be worth making it defer to the new rule for consistency

@duckduckgrayduck

Copy link
Copy Markdown
Contributor

Looks good to me. One non-blocking note: there are now two permissions about viewing collaborators.

1. projects.view_collaborators (new in this PR)

Checked against a project: user.has_perm("projects.view_collaborators", project) Answers “can this user see the collaborator list for this project?” Rule: logged in and on the project (view, edit or admin)

2. projects.view_collaboration (existing)

Checked against a single collaborator: user.has_perm("projects.view_collaboration", collaboration) Answers “can this user see this one collaborator?” Rule (in projects/rules.py): logged in and an admin on that collaborator’s project Nothing checks it. Django generates the permission name for the Collaboration model, and DRF doesn’t check view permissions on GET.

Since the second one now contradicts the first, it might be worth making it defer to the new rule for consistency

Also, let's merge this to staging first. I want to see if anything else (front or backend) comes up now that we actually show the collaborators for other members. I suspect something might crop up that we'll want to do a follow up about

@dnass
dnass changed the base branch from master to staging November 19, 2026 22:38
@dnass
dnass changed the base branch from staging to master November 19, 2026 22:41
@dnass

dnass commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@duckduckgrayduck is this what you had in mind? Also, I opened up #545 against staging.

@duckduckgrayduck

Copy link
Copy Markdown
Contributor

@duckduckgrayduck is this what you had in mind? Also, I opened up #545 against staging.

view_collaboration is checked against a collaboration, but can_view_collaborators expects a project, so this would raise as written if anything called it.

I'm probably overthinking it anyways, as this is currently unused. If it ever does come into use, we can worry about it then. You can revert the last commit.

@dnass
dnass force-pushed the 534-project-collaborators-visibility branch from 3f6292c to 427d630 Compare November 20, 2026 00:48
@dnass

dnass commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Ok, done. I need to learn more about how DRF permissions work.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Viewers & edit collaborators on a project can't see the list of collaborators

2 participants