security: enforce recursive delete authorization
This commit is contained in:
@@ -336,6 +336,10 @@ func (s *Server) remove(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSONError(w, http.StatusForbidden, "has no privilege")
|
||||
return
|
||||
}
|
||||
if e := checkDeleteTree(s.Store, a, p); e != nil {
|
||||
writeJSONError(w, http.StatusForbidden, "has no privilege")
|
||||
return
|
||||
}
|
||||
if e := s.removePath(p); e != nil {
|
||||
http.Error(w, e.Error(), 500)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user