mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-16 17:43:13 +02:00
Rename /access to /reservation
This commit is contained in:
parent
d4ec5eb497
commit
24529bd0ad
5 changed files with 24 additions and 26 deletions
server
|
@ -316,7 +316,7 @@ func (s *Server) handleAccountSubscriptionDelete(w http.ResponseWriter, r *http.
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) handleAccountAccessAdd(w http.ResponseWriter, r *http.Request, v *visitor) error {
|
||||
func (s *Server) handleAccountReservationAdd(w http.ResponseWriter, r *http.Request, v *visitor) error {
|
||||
if v.user != nil && v.user.Role == user.RoleAdmin {
|
||||
return errHTTPBadRequestMakesNoSenseForAdmin
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ func (s *Server) handleAccountAccessAdd(w http.ResponseWriter, r *http.Request,
|
|||
return errHTTPBadRequestPermissionInvalid
|
||||
}
|
||||
if v.user.Tier == nil {
|
||||
return errHTTPUnauthorized // FIXME there should always be a plan!
|
||||
return errHTTPUnauthorized
|
||||
}
|
||||
if err := s.userManager.CheckAllowAccess(v.user.Name, req.Topic); err != nil {
|
||||
return errHTTPConflictTopicReserved
|
||||
|
@ -361,8 +361,8 @@ func (s *Server) handleAccountAccessAdd(w http.ResponseWriter, r *http.Request,
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) handleAccountAccessDelete(w http.ResponseWriter, r *http.Request, v *visitor) error {
|
||||
matches := accountAccessSingleRegex.FindStringSubmatch(r.URL.Path)
|
||||
func (s *Server) handleAccountReservationDelete(w http.ResponseWriter, r *http.Request, v *visitor) error {
|
||||
matches := accountReservationSingleRegex.FindStringSubmatch(r.URL.Path)
|
||||
if len(matches) != 2 {
|
||||
return errHTTPInternalErrorInvalidPath
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue