瀏覽代碼

Restricted users only see repos in orgs which their team was assigned to (#28025) (#28050)

Backport #28025 by @6543


---
*Sponsored by Kithara Software GmbH*

Co-authored-by: 6543 <m.huber@kithara.com>
tags/v1.20.6
Giteabot 6 月之前
父節點
當前提交
439e071acf
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 5 行新增5 行删除
  1. 5
    5
      models/repo/repo_list.go

+ 5
- 5
models/repo/repo_list.go 查看文件

@@ -637,12 +637,12 @@ func AccessibleRepositoryCondition(user *user_model.User, unitType unit.Type) bu
userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType),
)
}
cond = cond.Or(
// 4. Repositories that we directly own
builder.Eq{"`repository`.owner_id": user.ID},
// 4. Repositories that we directly own
cond = cond.Or(builder.Eq{"`repository`.owner_id": user.ID})
if !user.IsRestricted {
// 5. Be able to see all public repos in private organizations that we are an org_user of
userOrgPublicRepoCond(user.ID),
)
cond = cond.Or(userOrgPublicRepoCond(user.ID))
}
}

return cond

Loading…
取消
儲存