Fix system admin cannot fork or get private fork with API (#33401)

Fix #33368
This commit is contained in:
Lunny Xiao authored and GitHub committed 2025-01-27 16:25:14 +00:00
1 parent dcd3014567
commit 77d14fb6d3
4 files changed
+47 -13

No files matched your search

+2 -1
View File
@@ -118,7 +118,8 @@ func TestForkListLimitedAndPrivateRepos(t *testing.T) {
req := NewRequest(t, "GET", "/user2/repo1/forks")
resp := user1Sess.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
assert.EqualValues(t, 1, htmlDoc.Find(forkItemSelector).Length())
// since user1 is an admin, he can get both of the forked repositories
assert.EqualValues(t, 2, htmlDoc.Find(forkItemSelector).Length())
assert.NoError(t, org_service.AddTeamMember(db.DefaultContext, ownerTeam2, user1))
resp = user1Sess.MakeRequest(t, req, http.StatusOK)