Refactor GitAccess and related code to remove build_download_code

The following discussion from gitlab-ce!11398 should be addressed:

  • @DouweM started a discussion: (+5 comments)

    Do you understand why we have a separate build_download_code and download_code? :/

    /cc @ayufan

    ...

    What we want to accomplish is that GitAccess gives admin users access to all projects unless the access check is coming from a CI build, in which case GitAccess should only allow access to projects the admin has access to through normal non-admin means, like being a member, the project being public etc.

    We could accomplish this by telling GitAccess that the request is coming from a CI build, and not just checking can?(current_user, :download_code, project) in this case, but also verifying the reason for this access.

Edited Jun 17, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading