MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / requireOwnedReview

Method requireOwnedReview

internal/httpapi/reviews.go:127–136  ·  view source on GitHub ↗

requireOwnedReview resolves a held message by id, scoped to the account, and returns it (404 if it isn't a hold the account owns). The ownership check is the tenant guard for the id-only review routes.

(ctx context.Context, userID, id string)

Source from the content-addressed store, hash-verified

125// returns it (404 if it isn't a hold the account owns). The ownership check is
126// the tenant guard for the id-only review routes.
127func (s *Server) requireOwnedReview(ctx context.Context, userID, id string) (*identity.Message, error) {
128 if s.deps.GetReviewWithContent == nil {
129 return nil, NewError(http.StatusNotImplemented, "not_implemented", "reviews are not available on this deployment")
130 }
131 msg, err := s.deps.GetReviewWithContent(ctx, userID, id)
132 if err != nil || msg == nil {
133 return nil, NewError(http.StatusNotFound, "not_found", "review not found")
134 }
135 return msg, nil
136}
137
138func (s *Server) handleGetReview(ctx context.Context, in *getReviewInput) (*reviewDetailOutput, error) {
139 p, err := s.requireAccountScope(ctx)

Callers 3

handleGetReviewMethod · 0.95
handleApproveReviewMethod · 0.95
handleRejectReviewMethod · 0.95

Calls 2

NewErrorFunction · 0.85
GetReviewWithContentMethod · 0.80

Tested by

no test coverage detected