mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-13 05:50:27 +00:00
Fix uploading attachments on wikis with no auth
This commit is contained in:
parent
ce8da047ea
commit
a885253d12
@ -174,7 +174,7 @@ func handlerUploadBinary(w http.ResponseWriter, rq *http.Request) {
|
|||||||
log.Println(rq.URL)
|
log.Println(rq.URL)
|
||||||
var (
|
var (
|
||||||
hyphaName = HyphaNameFromRq(rq, "upload-binary")
|
hyphaName = HyphaNameFromRq(rq, "upload-binary")
|
||||||
u = user.FromRequest(rq)
|
u = user.FromRequest(rq).OrAnon()
|
||||||
)
|
)
|
||||||
if !u.CanProceed("upload-binary") {
|
if !u.CanProceed("upload-binary") {
|
||||||
HttpErr(w, http.StatusForbidden, hyphaName, "Not enough rights", "You must be an editor to upload attachments.")
|
HttpErr(w, http.StatusForbidden, hyphaName, "Not enough rights", "You must be an editor to upload attachments.")
|
||||||
|
Loading…
Reference in New Issue
Block a user