More auth

This commit is contained in:
Philipp Heckel 2022-01-24 00:54:28 -05:00
parent 393f95aeac
commit 460162737a
9 changed files with 264 additions and 230 deletions

View file

@ -1144,7 +1144,7 @@ func (s *Server) withAuth(next handleFunc, perm auth.Permission) handleFunc {
}
if err := s.auth.Authorize(user, t.ID, perm); err != nil {
log.Printf("unauthorized: %s", err.Error())
return errHTTPUnauthorized
return errHTTPForbidden
}
return next(w, r, v)
}