Skip to content

RemoteRepository.admin is not set properly on GitLab #7475

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

Closed
humitos opened this issue Sep 10, 2020 · 0 comments · Fixed by #7479
Closed

RemoteRepository.admin is not set properly on GitLab #7475

humitos opened this issue Sep 10, 2020 · 0 comments · Fixed by #7479
Assignees

Comments

@humitos
Copy link
Member

humitos commented Sep 10, 2020

When syncing RemoteRepository we are not setting admin field properly. We only set it to True when the user is the owner of the repository. It could be that the user is "Maintainer" (full access) but not owner.

The code that needs to be changed is at

repo.admin = not repo_is_public
if not repo.admin and 'owner' in fields:
repo.admin = self.is_owned_by(fields['owner']['id'])

GitLab is returning the permissions as:

"permissions": {"project_access": {"access_level": 40, "notification_level": 3}

https://docs.gitlab.com/ee/api/access_requests.html

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 a pull request may close this issue.

1 participant