aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/api/handler.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/api/handler.go b/backend/api/handler.go
index f7595dc..674424f 100644
--- a/backend/api/handler.go
+++ b/backend/api/handler.go
@@ -116,7 +116,7 @@ func (h *Handler) GetGames(ctx context.Context, _ GetGamesRequestObject, _ *auth
}, nil
}
-func (h *Handler) GetGame(ctx context.Context, request GetGameRequestObject, _ *auth.JWTClaims) (GetGameResponseObject, error) {
+func (h *Handler) GetGame(ctx context.Context, request GetGameRequestObject, user *auth.JWTClaims) (GetGameResponseObject, error) {
gameID := request.GameID
row, err := h.q.GetGameByID(ctx, int32(gameID))
if err != nil {
@@ -129,7 +129,7 @@ func (h *Handler) GetGame(ctx context.Context, request GetGameRequestObject, _ *
}
return nil, echo.NewHTTPError(http.StatusInternalServerError, err.Error())
}
- if !row.IsPublic {
+ if !row.IsPublic && !user.IsAdmin {
return GetGame404JSONResponse{
NotFoundJSONResponse: NotFoundJSONResponse{
Message: "Game not found",