cannot grant access to another group in my project
### Summary
I cannot grant access to another group in my project. I am the owner of the subgroup the project is in, but not specifically of the project itself. I cannot grant myself ownership to that project.
### Steps to reproduce
When I go to the project -> members -> invite group, only two groups are listed: I suspect those are groups I am a part of, but it's unclear why those two groups are there (because other groups I'm a member of are not listed). The group I want to add is not listed.
### Example Project
I cannot reproduce this on gitlab.com.
### What is the current *bug* behavior?
Only a subset of the groups of the gitlab instance are listed, presumably only the groups I'm a member of.
### What is the expected *correct* behavior?
All groups should be listed or at least be selectable/searchable somehow.
### Relevant logs and/or screenshots
The dialog, as a user, shows only two groups:

As an instance admin, I see way more:

### Output of checks
#### Results of GitLab environment info
<!-- Input any relevant GitLab environment information if needed. -->
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
System information
System: Debian 10
Current User: git
Using RVM: no
Ruby Version: 2.7.2p137
Gem Version: 3.1.4
Bundler Version:2.1.4
Rake Version: 13.0.1
Redis Version: 5.0.9
Git Version: 2.29.0
Sidekiq Version:5.2.9
Go Version: unknown
GitLab information
Version: 13.7.4
Revision: 2f14978e280
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 11.9
URL: https://gitlab.torproject.org
HTTP Clone URL: https://gitlab.torproject.org/some-group/some-project.git
SSH Clone URL: git@gitlab.torproject.org:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 13.14.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
</pre>
</details>
#### Results of GitLab application Check
<!-- Input any relevant GitLab application check information if needed. -->
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 13.14.0 ? ... OK (13.14.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: ... Checking Reply by email ...
IMAP server credentials are correct? ... Checking git@gitlab.torproject.org
yes
Init.d configured correctly? ... skipped
MailRoom running? ... skipped
Checking Reply by email ... Finished
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
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: ...
230/10 ... yes
258/11 ... yes
231/14 ... yes
191/16 ... yes
258/19 ... yes
258/20 ... yes
258/21 ... yes
258/22 ... yes
258/23 ... yes
258/24 ... yes
258/25 ... yes
258/26 ... yes
259/27 ... yes
258/28 ... yes
258/29 ... yes
301/30 ... yes
253/32 ... yes
301/33 ... yes
246/35 ... yes
246/36 ... yes
246/37 ... yes
253/38 ... yes
171/39 ... yes
265/43 ... yes
234/44 ... yes
258/45 ... yes
262/46 ... yes
159/47 ... yes
144/48 ... yes
262/49 ... yes
230/50 ... yes
259/52 ... yes
262/53 ... yes
277/56 ... yes
171/57 ... yes
277/58 ... yes
253/59 ... yes
277/60 ... yes
277/61 ... yes
277/62 ... yes
262/64 ... yes
171/65 ... yes
252/68 ... yes
226/70 ... yes
246/71 ... yes
263/72 ... yes
263/73 ... yes
252/75 ... yes
263/76 ... yes
246/77 ... yes
246/78 ... yes
274/81 ... yes
230/87 ... yes
271/88 ... yes
271/89 ... yes
271/90 ... yes
271/91 ... yes
259/92 ... yes
253/95 ... yes
301/96 ... yes
294/99 ... yes
295/100 ... yes
296/101 ... yes
209/102 ... yes
297/103 ... yes
171/105 ... yes
226/106 ... yes
226/107 ... yes
226/108 ... yes
226/109 ... yes
263/110 ... yes
263/111 ... yes
263/112 ... yes
271/118 ... yes
263/119 ... yes
231/120 ... yes
132/243 ... yes
263/248 ... yes
275/249 ... yes
263/250 ... yes
246/251 ... yes
255/252 ... yes
258/253 ... yes
246/254 ... yes
231/255 ... yes
246/256 ... yes
246/257 ... yes
262/258 ... yes
230/261 ... yes
159/262 ... yes
171/263 ... yes
255/265 ... yes
295/266 ... yes
258/288 ... yes
258/289 ... yes
258/290 ... yes
246/291 ... yes
230/292 ... yes
230/293 ... yes
230/294 ... yes
255/295 ... yes
275/296 ... yes
275/297 ... yes
188/298 ... yes
275/299 ... yes
275/300 ... yes
275/301 ... yes
247/302 ... yes
258/303 ... yes
188/304 ... yes
140/305 ... yes
296/306 ... yes
135/308 ... yes
296/309 ... yes
275/310 ... yes
156/312 ... yes
259/313 ... yes
191/315 ... yes
184/316 ... yes
275/321 ... yes
217/322 ... yes
262/323 ... yes
340/324 ... yes
188/325 ... yes
188/326 ... yes
231/327 ... yes
188/328 ... yes
351/330 ... yes
262/331 ... yes
247/332 ... yes
217/333 ... yes
263/334 ... yes
354/335 ... yes
263/336 ... yes
263/337 ... yes
262/338 ... yes
231/339 ... yes
263/340 ... yes
256/342 ... yes
184/343 ... yes
134/344 ... yes
134/345 ... yes
134/346 ... yes
184/361 ... yes
477/409 ... yes
477/410 ... yes
477/411 ... yes
262/412 ... yes
363/414 ... yes
3/415 ... yes
262/416 ... yes
265/417 ... yes
265/418 ... yes
265/419 ... yes
262/420 ... yes
277/421 ... yes
277/422 ... yes
277/423 ... yes
277/424 ... yes
277/425 ... yes
478/426 ... yes
478/427 ... yes
478/428 ... yes
478/429 ... yes
478/430 ... yes
478/431 ... yes
478/432 ... yes
478/433 ... yes
478/434 ... yes
275/435 ... yes
275/436 ... yes
477/437 ... yes
477/438 ... yes
477/439 ... yes
480/440 ... yes
480/441 ... yes
479/442 ... yes
479/443 ... yes
479/444 ... yes
479/445 ... yes
479/446 ... yes
479/447 ... yes
479/448 ... yes
479/449 ... yes
479/450 ... yes
479/451 ... yes
479/452 ... yes
479/453 ... yes
479/454 ... yes
479/455 ... yes
479/456 ... yes
479/457 ... yes
479/458 ... yes
479/459 ... yes
259/460 ... yes
258/461 ... yes
258/462 ... yes
258/463 ... yes
258/464 ... yes
258/465 ... yes
258/466 ... yes
258/467 ... yes
258/468 ... yes
480/469 ... yes
156/470 ... yes
477/471 ... yes
477/472 ... yes
477/473 ... yes
477/474 ... yes
477/475 ... yes
477/476 ... yes
477/477 ... yes
477/478 ... yes
477/479 ... yes
477/480 ... yes
477/481 ... yes
480/487 ... yes
237/488 ... yes
231/489 ... yes
171/491 ... yes
237/493 ... yes
231/496 ... yes
255/498 ... yes
251/499 ... yes
384/504 ... yes
384/505 ... yes
384/506 ... yes
237/507 ... yes
237/508 ... yes
301/509 ... yes
231/510 ... yes
355/511 ... yes
265/512 ... yes
265/513 ... yes
217/514 ... yes
188/517 ... yes
188/519 ... yes
188/520 ... yes
188/521 ... yes
188/523 ... yes
188/524 ... yes
188/525 ... yes
256/526 ... yes
478/527 ... yes
191/528 ... yes
231/530 ... yes
231/531 ... yes
231/532 ... yes
231/533 ... yes
407/534 ... yes
135/535 ... yes
135/536 ... yes
135/537 ... yes
256/538 ... yes
184/539 ... yes
231/540 ... yes
231/541 ... yes
263/542 ... yes
478/543 ... yes
135/544 ... yes
480/545 ... yes
480/546 ... yes
262/549 ... yes
252/550 ... yes
184/551 ... yes
140/552 ... yes
407/553 ... yes
171/555 ... yes
384/556 ... yes
256/557 ... yes
387/558 ... yes
262/559 ... yes
138/560 ... yes
263/562 ... yes
262/563 ... yes
191/564 ... yes
171/565 ... yes
479/566 ... yes
495/568 ... yes
184/569 ... yes
2/570 ... yes
268/571 ... yes
477/572 ... yes
493/573 ... yes
171/574 ... yes
255/575 ... yes
370/576 ... yes
507/577 ... yes
507/578 ... yes
507/579 ... yes
252/580 ... yes
256/581 ... yes
231/582 ... yes
156/583 ... yes
255/584 ... yes
478/585 ... yes
171/586 ... yes
217/587 ... yes
251/588 ... yes
483/589 ... yes
275/590 ... yes
275/591 ... yes
177/593 ... yes
251/595 ... yes
217/596 ... yes
387/597 ... yes
184/598 ... yes
252/599 ... yes
191/600 ... yes
231/601 ... yes
135/602 ... yes
384/603 ... yes
252/604 ... yes
140/605 ... yes
274/606 ... yes
268/607 ... yes
230/608 ... yes
536/610 ... yes
184/611 ... yes
184/612 ... yes
189/613 ... yes
407/614 ... yes
237/615 ... yes
230/616 ... yes
217/617 ... yes
477/618 ... yes
184/619 ... yes
255/622 ... yes
263/627 ... yes
135/628 ... yes
177/629 ... yes
586/630 ... yes
483/631 ... yes
464/632 ... yes
256/633 ... yes
609/634 ... yes
502/636 ... yes
177/637 ... yes
409/638 ... yes
282/639 ... yes
652/640 ... yes
442/641 ... yes
643/642 ... yes
256/643 ... yes
479/644 ... yes
140/645 ... yes
478/647 ... yes
275/648 ... yes
252/649 ... yes
171/650 ... yes
282/651 ... yes
189/652 ... yes
262/654 ... yes
171/655 ... yes
479/656 ... yes
263/657 ... yes
265/659 ... yes
184/660 ... yes
688/661 ... yes
671/662 ... yes
188/663 ... yes
231/664 ... yes
239/666 ... yes
184/669 ... yes
263/670 ... yes
2/671 ... yes
256/672 ... yes
230/673 ... yes
2/674 ... yes
217/675 ... yes
410/676 ... yes
188/677 ... yes
769/678 ... yes
252/679 ... yes
258/680 ... yes
135/681 ... yes
444/682 ... yes
237/683 ... yes
783/685 ... yes
427/686 ... yes
380/687 ... yes
780/688 ... yes
790/691 ... yes
188/692 ... yes
792/693 ... yes
789/694 ... yes
480/695 ... yes
527/696 ... yes
491/697 ... yes
231/698 ... yes
817/699 ... yes
794/700 ... yes
237/701 ... yes
252/702 ... yes
263/703 ... yes
839/704 ... yes
813/705 ... yes
410/706 ... yes
134/707 ... yes
817/708 ... yes
171/709 ... yes
262/710 ... yes
156/711 ... yes
263/712 ... yes
237/713 ... yes
252/714 ... yes
275/715 ... yes
171/716 ... yes
188/717 ... yes
251/718 ... yes
188/721 ... yes
184/722 ... yes
502/723 ... yes
409/724 ... yes
909/726 ... yes
780/727 ... yes
262/728 ... yes
893/729 ... yes
913/730 ... yes
752/731 ... yes
156/732 ... yes
478/733 ... yes
231/734 ... yes
188/735 ... yes
217/736 ... yes
217/737 ... yes
171/738 ... yes
262/739 ... yes
480/740 ... yes
237/741 ... yes
231/742 ... yes
788/743 ... yes
231/744 ... yes
217/745 ... yes
191/746 ... yes
480/747 ... yes
301/748 ... yes
156/749 ... yes
217/750 ... yes
258/751 ... yes
931/752 ... yes
171/754 ... yes
180/756 ... yes
251/757 ... yes
648/758 ... yes
251/759 ... yes
967/760 ... yes
251/761 ... yes
251/762 ... yes
251/763 ... yes
251/764 ... yes
251/765 ... yes
251/766 ... yes
251/767 ... yes
251/768 ... yes
251/769 ... yes
780/770 ... yes
135/771 ... yes
999/772 ... yes
999/773 ... yes
237/774 ... yes
788/775 ... yes
1008/776 ... yes
188/777 ... yes
1008/778 ... yes
780/779 ... yes
188/780 ... yes
189/781 ... yes
184/782 ... yes
780/783 ... yes
410/785 ... yes
480/786 ... yes
307/787 ... yes
354/788 ... yes
282/789 ... yes
Redis version >= 4.0.0? ... yes
Ruby version >= 2.7.2 ? ... yes (2.7.2)
Git version >= 2.29.0 ? ... yes (2.29.0)
Git user has default SSH configuration? ... yes
Active users: ... 705
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
</pre>
</details>
### Possible fixes
I haven't investigated the source, but it seems to me that at least searching for a group should show it, even if I'm not part of it. I understand that we not want to list *all* groups (especially on large sites like gitlab.com) to to restrict the length of the list, but at least we should be able to find other groups we know about.
PS: I did try to search for a similar issue in the issue queue, but I am getting 500 errors when searching.
issue