Skip to content

[fix] 작곡가 생성 어드민 ID 수정 (1 → 5)#96

Merged
k3vin7 merged 1 commit intomainfrom
fix/adminId
Mar 3, 2026
Merged

[fix] 작곡가 생성 어드민 ID 수정 (1 → 5)#96
k3vin7 merged 1 commit intomainfrom
fix/adminId

Conversation

@k3vin7
Copy link
Contributor

@k3vin7 k3vin7 commented Mar 3, 2026

Summary

  • 작곡가 생성 어드민 체크 ID를 1 → 5로 수정 (프로덕션 DB 기준)

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 작곡가 생성 기능의 관리자 권한 확인 로직을 업데이트하여, 프로덕션 환경에서 올바른 관리자 ID가 사용되도록 보장합니다. 기존에 하드코딩된 관리자 ID를 실제 운영 환경에 맞는 ID로 수정함으로써, 시스템의 안정성과 정확성을 향상시키는 데 중점을 둡니다.

Highlights

  • 작곡가 생성 어드민 ID 수정: 작곡가 생성 시 어드민 권한을 확인하는 로직에서 사용되는 ID를 기존 '1'에서 '5'로 변경했습니다. 이는 프로덕션 데이터베이스의 변경 사항을 반영합니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/java/com/daramg/server/composer/application/ComposerService.java
    • 작곡가 생성 로직 내에서 관리자 ID '1L'을 '5L'로 변경했습니다.
Activity
  • 아직 인간 활동이 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@k3vin7 k3vin7 merged commit f83a8ef into main Mar 3, 2026
1 check passed
@k3vin7 k3vin7 deleted the fix/adminId branch March 3, 2026 11:01
Copy link

@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 PR updates the admin ID for composer creation, changing the hardcoded ID from "1L" to "5L" to align with the production environment. However, hardcoding user IDs for authorization is a brittle and insecure practice; it is recommended to implement a proper Role-Based Access Control (RBAC) system to manage administrative privileges. Additionally, hardcoding IDs directly in the code can hinder maintainability. It's recommended to extract this ID into a constant or separate it into an external configuration file for better readability and flexibility.

@Transactional
public void createComposer(ComposerCreateDto dto, User user) {
if (user.getId() != 1L) {
if (user.getId() != 5L) {

Choose a reason for hiding this comment

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

security-medium medium

The createComposer method uses a hardcoded user ID (5L) for administrative privilege verification, which is a brittle and insecure way to implement access control. Hardcoding user IDs makes the application's security logic dependent on specific database states and can lead to unauthorized access if ID mappings are inconsistent or misused. It is recommended to implement a Role-Based Access Control (RBAC) system, checking for an 'ADMIN' role or specific permissions instead of a hardcoded user ID. Additionally, the hardcoded 'magic number' 5L should be extracted into a constant for clarity and maintainability. When comparing Long objects, use equals() instead of !=. For better flexibility, consider managing such values in external configuration files (e.g., application.properties) to allow updates without redeployment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant