mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-02 13:44:16 +09:00
fix(feed): require code read access for the repo home branch feed (#39964)
Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
5 files changed
+17
-9
No files matched your search
@@ -153,4 +153,12 @@ func TestFeedUser(t *testing.T) {
|
||||
assert.NotContains(t, data, "pre-release")
|
||||
assert.NotContains(t, data, "some text for a pre release")
|
||||
})
|
||||
|
||||
t.Run("RepoBranchFeedWithoutCodeAccess", func(t *testing.T) {
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
|
||||
require.NoError(t, repo_service.UpdateRepositoryUnits(t.Context(), repo, nil, []unit_model.Type{unit_model.TypeCode}))
|
||||
MakeRequest(t, NewRequest(t, "GET", "/user2/repo1").SetHeader("Accept", "application/rss+xml"), http.StatusNotFound)
|
||||
MakeRequest(t, NewRequest(t, "GET", "/user2/repo1").SetHeader("Accept", "application/atom+xml"), http.StatusNotFound)
|
||||
MakeRequest(t, NewRequest(t, "GET", "/user2/repo1.rss"), http.StatusOK)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user