Skip to content

chore(be): modify getContests permission for Reviewer#3571

Open
hjkim24 wants to merge 6 commits into
mainfrom
t2712-block-get-contests-permission-for-reviewer
Open

chore(be): modify getContests permission for Reviewer#3571
hjkim24 wants to merge 6 commits into
mainfrom
t2712-block-get-contests-permission-for-reviewer

Conversation

@hjkim24
Copy link
Copy Markdown
Contributor

@hjkim24 hjkim24 commented May 20, 2026

Description

admin 단의 contestResolver에는 UseContestRolesGuard(ContestRole.Manager)를 통해 기본적으로 모든 API 요청에 대해 ContestManager이상만 접근 가능한 상황입니다.

GetContests의 경우 @UseDisableContestRolesGuard()를 통해 가드를 비활성화한 후 내부에서 따로 Reviewer를 포함하여 권한 검증을 진행하고 있으나, Contest Reviewer의 경우 Contest 탭에서 해당 대회를 조회할 수 없어야하므로 이를 수정합니다.

Additional context


closes TAS-2712

Before submitting the PR, please make sure you do the following

@hjkim24 hjkim24 requested review from RyuRaseul and lshtar13 May 20, 2026 05:41
@hjkim24 hjkim24 self-assigned this May 20, 2026
@hjkim24 hjkim24 added the 🪰 bug Something isn't working label May 20, 2026
@hjkim24 hjkim24 added this to Codedang May 20, 2026
@github-project-automation github-project-automation Bot moved this to Pending ✋ in Codedang May 20, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request restricts contest access by removing the Reviewer role from the allowed list and updates the GraphQL schema with new group tag and study information types. It also corrects character encoding in schema descriptions and transitions the user OAuth field to an array. Feedback focuses on a potential authorization failure in the contest resolver where a guard was incorrectly replaced rather than supplemented, and notes that the API documentation should be updated to reflect the new role restrictions.

Comment thread apps/backend/apps/admin/src/contest/contest.resolver.ts
Comment thread collection/admin/Contest/Get Contests/Succeed.bru
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the contest access control logic by restricting access to 'Admin' and 'Manager' roles, effectively removing 'Reviewer' access. The changes include updating the contest resolver and service, as well as documentation in the Bruno collection. Additionally, the PR includes significant schema updates, such as the addition of 'GroupTag' and 'StudyInfo' types and modifications to 'UserOAuth', which the reviewer suggests should be separated into a distinct pull request for better maintainability. Feedback highlights the need to synchronize documentation with the updated code and suggests decoupling unrelated schema changes.

Comment thread apps/backend/apps/admin/src/contest/contest.service.ts
Comment thread collection/admin/Contest/Get Contests/Succeed.bru
Comment thread apps/backend/schema.gql
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the contest access control logic by restricting the 'getContests' query to 'Admin' and 'Manager' roles, removing 'Reviewer' access. The review comments highlight that the corresponding documentation and JSDoc comments still reference 'Reviewer' and should be updated for consistency. Additionally, the reviewer noted that the pull request includes significant schema changes related to 'GroupTag' and 'StudyInfo' that appear unrelated to the primary goal of the PR, suggesting that these should either be removed or explicitly justified in the PR description.

Comment thread apps/backend/apps/admin/src/contest/contest.service.ts
Comment thread collection/admin/Contest/Get Contests/Succeed.bru
Comment thread apps/backend/schema.gql
@Choi-Jung-Hyeon Choi-Jung-Hyeon linked an issue May 22, 2026 that may be closed by this pull request
27 tasks
Copy link
Copy Markdown
Contributor

@Choi-Jung-Hyeon Choi-Jung-Hyeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제미나이봇이 지적했던 PR 범위에 안맞는 schema.gql 변경사항 의도된거라면 다른건 좋은듯~! 이거만 한번 확인 부탁!

@github-project-automation github-project-automation Bot moved this from Pending ✋ to Approved 👌 in Codedang May 24, 2026
Copy link
Copy Markdown
Contributor

@RyuRaseul RyuRaseul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hjkim24 hjkim24 added this pull request to the merge queue May 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 25, 2026
Copy link
Copy Markdown
Contributor

@EddieDawn EddieDawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema.gql에 제미나이 커멘트 말고는 저도 LGTM!

Comment thread apps/backend/schema.gql
@RyuRaseul
Copy link
Copy Markdown
Contributor

RyuRaseul commented May 25, 2026

근데 다시보니까 이미 리졸버 레벨에서 ContestManagerGuard가 걸려있는 거 아닌가용
그냥 Disable 빼면 해결되는 문제 아닌감

일단 머지 ㄴㄴ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪰 bug Something isn't working ⛳️ team-backend

Projects

Status: Approved 👌

Development

Successfully merging this pull request may close these issues.

[Bug]: 26-1 백엔드 버그픽스

4 participants