allow team leaders to edit their teams #1758
Draft
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.
We want to give team leaders permission to approve PRs in this repository, so that they can unblock their teams.
The question is: how much permission can we give them? If you look at the CODEOWNERS file, you can see that anyone with write access can approve PRs in the
/people
/repos
and/teams
directories.But what if an attacker compromises a team-lead's account? They could then approve their own PRs
to remove branch protection rules, kick out team members, or archive all rust-lang repositories.
To prevent this, we want to limit the permissions of team-leads to only the directories they own,
i.e. their
/teams
and the/repos
owned by their teams.With this PR, I start by giving team-leads write access to their own
/teams
directory.Con of this approach: team-repo-admins and mods will be notified about every change in the
people
,teams
andrepos
directory.leads = "write"
before this PR, so that team leads have write access