We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_:warning: Potential issue_
プロジェクト削除の権限チェックを追加することを推奨します
現在の実装ではユーザーの認証のみを確認していますが、そのユーザーが特定のプロジェクトを削除する権限を持っているかどうかの確認が必要です。
以下のような権限チェックの追加を提案します:
export async function deleteProjectAction(projectId: string) { try { const userId = await getSessionUserId(); if (!userId) { return { success: false, error: "ユーザーが認証されていません。" }; } + + // プロジェクトの所有者またはAdmin権限を持つユーザーかどうかを確認 + const projectUser = await prisma.projectUser.findFirst({ + where: { + projectId: projectId, + userId: userId, + role: 'ADMIN' + }, + }); + + if (!projectUser) { + return { success: false, error: "プロジェクトを削除する権限がありません。" }; + }
Committable suggestion skipped: line range outside the PR's diff.
Originally posted by @coderabbitai[bot] in #33 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
プロジェクト削除の権限チェックを追加することを推奨します
現在の実装ではユーザーの認証のみを確認していますが、そのユーザーが特定のプロジェクトを削除する権限を持っているかどうかの確認が必要です。
以下のような権限チェックの追加を提案します:
Originally posted by @coderabbitai[bot] in #33 (comment)
The text was updated successfully, but these errors were encountered: