Skip to content

Commit

Permalink
Return unauthorized error if the ACL check finds the current user is …
Browse files Browse the repository at this point in the history
…deactivated

Error found by huntr.dev.
  • Loading branch information
tianzhou committed Oct 14, 2021
1 parent d28de62 commit b237a48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/acl.go
Expand Up @@ -49,6 +49,9 @@ func ACLMiddleware(l *zap.Logger, s *Server, ce *casbin.Enforcer, next echo.Hand
}
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to process authorize request.").SetInternal(err)
}
if member.RowStatus == api.Archived {
return echo.NewHTTPError(http.StatusUnauthorized, "This user has been deactivated by the admin")
}

// If the requests is trying to PATCH/DELETE herself, we will change the method signature to
// XXX_SELF so that the policy can differentiate between XXX and XXX_SELF
Expand Down

0 comments on commit b237a48

Please sign in to comment.