0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-30 10:05:10 +01:00
gitea/models/organization
Gusted 1b53a9e914
Don't return duplicated users who can create org repo (#22560)
- Currently the function `GetUsersWhoCanCreateOrgRepo` uses a query that
is able to have duplicated users in the result, this is can happen under
the condition that a user is in team that either is the owner team or
has permission to create organization repositories.
- Add test code to simulate the above condition for user 3,
[`TestGetUsersWhoCanCreateOrgRepo`](a1fcb1cfb8/models/organization/org_test.go (L435))
is the test function that tests for this.
- The fix is quite trivial use a map keyed by user id in order to drop
duplicates.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-01-30 18:12:45 +08:00
..
main_test.go
mini_org.go
org_repo.go
org_test.go Don't return duplicated users who can create org repo (#22560) 2023-01-30 18:12:45 +08:00
org_user_test.go
org_user.go
org.go Don't return duplicated users who can create org repo (#22560) 2023-01-30 18:12:45 +08:00
team_invite_test.go
team_invite.go
team_list.go
team_repo.go
team_test.go
team_unit.go
team_user.go
team.go