mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 07:46:49 +00:00
[GITEA] Optionally allow anyone to edit Wikis (squash) AddTokenAuth
This commit is contained in:
parent
1296f4d115
commit
fed50cf72e
|
@ -234,12 +234,12 @@ func TestAPIEditOtherWikiPage(t *testing.T) {
|
||||||
|
|
||||||
// Creating a new Wiki page on user2's repo as user1 fails
|
// Creating a new Wiki page on user2's repo as user1 fails
|
||||||
testCreateWiki := func(expectedStatusCode int) {
|
testCreateWiki := func(expectedStatusCode int) {
|
||||||
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/wiki/new?token=%s", otherUsername, "repo1", token)
|
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/wiki/new", otherUsername, "repo1")
|
||||||
req := NewRequestWithJSON(t, "POST", urlStr, &api.CreateWikiPageOptions{
|
req := NewRequestWithJSON(t, "POST", urlStr, &api.CreateWikiPageOptions{
|
||||||
Title: "Globally Edited Page",
|
Title: "Globally Edited Page",
|
||||||
ContentBase64: base64.StdEncoding.EncodeToString([]byte("Wiki page content for API unit tests")),
|
ContentBase64: base64.StdEncoding.EncodeToString([]byte("Wiki page content for API unit tests")),
|
||||||
Message: "",
|
Message: "",
|
||||||
})
|
}).AddTokenAuth(token)
|
||||||
session.MakeRequest(t, req, expectedStatusCode)
|
session.MakeRequest(t, req, expectedStatusCode)
|
||||||
}
|
}
|
||||||
testCreateWiki(http.StatusForbidden)
|
testCreateWiki(http.StatusForbidden)
|
||||||
|
|
Loading…
Reference in a new issue