Revert the deliberate break (#8299)
Run 11302 failed all ten named tests, and with them apierror's
TestWrite_SendsTheEnvelopeAndHidesAPlainErrorsText and api's
TestFlag_BadReason, which pin the same rules from the handler side.
This reverts commit 21adbc2283.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ func RequireAdmin() func(http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
user, ok := UserFromContext(r.Context())
|
||||
if !ok && false /* DELIBERATE BREAK */ {
|
||||
if !ok {
|
||||
// Programmer error: RequireUser was not mounted before RequireAdmin.
|
||||
apierror.Write(w, apierror.InternalMsg("admin check mounted without a user", nil))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user