Commit a8b47149 authored by deads2k's avatar deads2k

you can be authorized and have a failure

parent 928b8cbd
...@@ -40,16 +40,17 @@ func WithAuthorization(handler http.Handler, getAttribs RequestAttributeGetter, ...@@ -40,16 +40,17 @@ func WithAuthorization(handler http.Handler, getAttribs RequestAttributeGetter,
return return
} }
authorized, reason, err := a.Authorize(attrs) authorized, reason, err := a.Authorize(attrs)
if err != nil { if authorized {
internalError(w, req, err) handler.ServeHTTP(w, req)
return return
} }
if !authorized { if err != nil {
glog.V(4).Infof("Forbidden: %#v, Reason: %s", req.RequestURI, reason) internalError(w, req, err)
forbidden(w, req)
return return
} }
handler.ServeHTTP(w, req)
glog.V(4).Infof("Forbidden: %#v, Reason: %s", req.RequestURI, reason)
forbidden(w, req)
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment