Allow collaborators to view repo owned private org (#6965)
Handle case where an orginization is private but a user who is not a member of the orgninization has been added as a collaborator of a repo within that org Fixes #6962
This commit is contained in:
parent
d9dcd09340
commit
68a83cc5a2
3 changed files with 27 additions and 4 deletions
|
@ -92,6 +92,15 @@ func TestPrivateOrg(t *testing.T) {
|
|||
req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org")
|
||||
session.MakeRequest(t, req, http.StatusNotFound)
|
||||
|
||||
// non-org member who is collaborator on repo in private org
|
||||
session = loginUser(t, "user4")
|
||||
req = NewRequest(t, "GET", "/privated_org")
|
||||
session.MakeRequest(t, req, http.StatusNotFound)
|
||||
req = NewRequest(t, "GET", "/privated_org/public_repo_on_private_org") // colab of this repo
|
||||
session.MakeRequest(t, req, http.StatusOK)
|
||||
req = NewRequest(t, "GET", "/privated_org/private_repo_on_private_org")
|
||||
session.MakeRequest(t, req, http.StatusNotFound)
|
||||
|
||||
// site admin
|
||||
session = loginUser(t, "user1")
|
||||
req = NewRequest(t, "GET", "/privated_org")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue