External users can't access internal project repositories as guests
Summary
In the project member permissions documentation, it notes that Guest users can view project code, pull project code, and download projects on public and internal projects.
If you grant an external user guest permissions on an internal project, the user cannot view project code, pull project code, or download the project.
From the documentation, these permissions should be supported. If this is the case, there is a bug in the permissions logic for external users.
Reported by an Ultimate SMB Premium customer --> https://gitlab.zendesk.com/agent/tickets/157549 (internal use only)
Steps to reproduce
- Create an internal project, Project A
- Create an external user, User 1
- Log in as User 1 and access Project A
- User 1 cannot access the repository in Project A
If User 1 is not external, but just a guest, they can access the repository in Project A. Additionally, if User 1 is external but is a reporter on Project A, they can access the repository.
What is the current bug behavior?
External guest users are not able to access an internal project's repository.
What is the expected correct behavior?
External guest users are able to access an internal project's repository.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.5p114 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.26.2 Sidekiq Version:5.2.7 Go Version: unknown GitLab information Version: 12.10.1-ee Revision: 695c29abcf7 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 11.7 URL: https://blunceford-omnibus-test.do.gitlap.com HTTP Clone URL: https://blunceford-omnibus-test.do.gitlap.com/some-group/some-project.git SSH Clone URL: git@blunceford-omnibus-test.do.gitlap.com:some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers: azure_oauth2, openid_connect GitLab Shell Version: 12.2.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 12.2.0 ? ... OK (12.2.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... Server: ldapmain Exception: getaddrinfo: Name or service not known
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 2/2 ... yes 2/3 ... yes 35/4 ... yes 35/5 ... yes 35/6 ... yes 35/7 ... yes 35/8 ... yes 36/9 ... yes 36/10 ... yes 37/11 ... yes 37/12 ... yes 37/13 ... yes 37/14 ... yes 37/15 ... yes 37/16 ... yes 38/17 ... yes 38/18 ... yes 38/19 ... yes 38/20 ... yes 38/21 ... yes 38/22 ... yes 39/23 ... yes 39/24 ... yes 39/25 ... yes 39/26 ... yes 39/27 ... yes 39/28 ... yes 39/29 ... yes 39/30 ... yes 40/31 ... yes 40/32 ... yes 41/33 ... yes 41/34 ... yes 41/35 ... yes 41/36 ... yes 41/37 ... yes 41/38 ... yes 41/39 ... yes 41/40 ... yes 41/41 ... yes 42/42 ... yes 42/43 ... yes 42/44 ... yes 42/45 ... yes 42/46 ... yes 42/47 ... yes 42/48 ... yes 42/49 ... yes 42/50 ... yes 42/51 ... yes 43/52 ... yes 43/53 ... yes 43/54 ... yes 44/55 ... yes 44/56 ... yes 44/57 ... yes 44/58 ... yes 44/59 ... yes 44/60 ... yes 44/61 ... yes 44/62 ... yes 45/63 ... yes 45/64 ... yes 45/65 ... yes 45/66 ... yes 45/67 ... yes 45/68 ... yes 45/69 ... yes 46/70 ... yes 46/71 ... yes 46/72 ... yes 47/73 ... yes 47/74 ... yes 47/75 ... yes 47/76 ... yes 47/77 ... yes 47/78 ... yes 47/79 ... yes 47/80 ... yes 48/81 ... yes 48/82 ... yes 48/83 ... yes 48/84 ... yes 48/85 ... yes 48/86 ... yes 48/87 ... yes 48/88 ... yes 48/89 ... yes 48/90 ... yes 49/91 ... yes 49/92 ... yes 49/93 ... yes 49/94 ... yes 49/95 ... yes 50/96 ... yes 50/97 ... yes 1/98 ... yes 1/99 ... yes 1/100 ... yes 1/101 ... yes 51/102 ... yes 51/103 ... yes 1/104 ... yes 1/105 ... yes 1/106 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.5) Git version >= 2.22.0 ? ... yes (2.26.2) Git user has default SSH configuration? ... yes Active users: ... 87 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... yes (7.5.2)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)