diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-09-19 15:10:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-09-19 15:10:06 +0900 |
| commit | 2c9033191a371fc587bdb47a0047e49818e55130 (patch) | |
| tree | e6d350924ce60288759d1cd113af6f8e08f473be /backend | |
| parent | 9eeb60e0d5d9c640837dce54ae7c2e800db15ce3 (diff) | |
| download | iosdc-japan-2025-albatross-main.tar.gz iosdc-japan-2025-albatross-main.tar.zst iosdc-japan-2025-albatross-main.zip | |
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/api/handler.go | 4 |
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", |
