Skip to content

Use correct team permissions when adding an Owner or Manager to a team #30

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions team-mapping-gitlab-gitguardian/gitguardian_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ def add_member_to_team(
Add a member to the team
"""

if member.access_level in (AccessLevel.OWNER, AccessLevel.MANAGER):
is_team_leader = True
incident_permission = IncidentPermission.FULL_ACCESS

payload = CreateTeamMember(
member_id=member.id,
is_team_leader=is_team_leader,
Expand Down
3 changes: 1 addition & 2 deletions team-mapping-gitlab-gitguardian/sync_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ def synchronize_team_members(
invitation_by_id[team_invitation.invitation_id].email,
)

team_id = gg_team.id
for member in members_to_add:
# If the member exists in GitGuardian, we can add him to the team
if member in members_by_emails:
Expand All @@ -351,7 +350,7 @@ def synchronize_team_members(
None,
)
if team_member_id:
remove_team_member(team_id, team_member_id)
remove_team_member(gg_team, team_member_id)


def infer_gitlab_email(
Expand Down