comment_new.go: enforce RequireIdentification when anonymous

Yikes, I can't believe I forgot about this.
This commit is contained in:
Adhityaa Chandrasekar 2019-02-18 11:07:16 -05:00
parent 7fc3910009
commit 52ce1e2660

View File

@ -77,6 +77,11 @@ func commentNewHandler(w http.ResponseWriter, r *http.Request) {
return
}
if d.RequireIdentification && *x.CommenterToken == "anonymous" {
bodyMarshal(w, response{"success": false, "message": errorNotAuthorised.Error()})
return
}
// logic: (empty column indicates the value doesn't matter)
// | anonymous | moderator | requireIdentification | requireModeration | moderateAllAnonymous | approved? |
// |-----------+-----------+-----------------------+-------------------+----------------------+-----------|