MCPcopy Create free account
hub / github.com/gogs/gogs / reqRepoWriter

Function reqRepoWriter

internal/route/api/v1/api.go:138–145  ·  view source on GitHub ↗

reqRepoWriter makes sure the context user has at least write access to the repository.

()

Source from the content-addressed store, hash-verified

136
137// reqRepoWriter makes sure the context user has at least write access to the repository.
138func reqRepoWriter() macaron.Handler {
139 return func(c *context.Context) {
140 if !c.Repo.IsWriter() {
141 c.Status(http.StatusForbidden)
142 return
143 }
144 }
145}
146
147// reqRepoAdmin makes sure the context user has at least admin access to the repository.
148func reqRepoAdmin() macaron.Handler {

Callers 1

RegisterRoutesFunction · 0.85

Calls 1

IsWriterMethod · 0.80

Tested by

no test coverage detected