-
Notifications
You must be signed in to change notification settings - Fork 11.1k
fix: Remove hosts - verify event type belongs to event type #25321
New issue
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
packages/trpc/server/routers/viewer/teams/removeHostsFromEventTypes.handler.ts
Show resolved
Hide resolved
packages/trpc/server/routers/viewer/teams/removeHostsFromEventTypes.handler.ts
Show resolved
Hide resolved
packages/features/membership/repositories/MembershipRepository.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/features/membership/repositories/MembershipRepository.ts">
<violation number="1" location="packages/features/membership/repositories/MembershipRepository.ts:144">
Limit this query to the fields actually consumed (e.g., userId) instead of returning full membership rows; otherwise Prisma fetches unnecessary, potentially sensitive columns.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| userIds: number[]; | ||
| teamId: number; | ||
| }) { | ||
| return prisma.membership.findMany({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit this query to the fields actually consumed (e.g., userId) instead of returning full membership rows; otherwise Prisma fetches unnecessary, potentially sensitive columns.
Prompt for AI agents
Address the following comment on packages/features/membership/repositories/MembershipRepository.ts at line 144:
<comment>Limit this query to the fields actually consumed (e.g., userId) instead of returning full membership rows; otherwise Prisma fetches unnecessary, potentially sensitive columns.</comment>
<file context>
@@ -134,6 +134,22 @@ export class MembershipRepository {
+ userIds: number[];
+ teamId: number;
+ }) {
+ return prisma.membership.findMany({
+ where: {
+ userId: { in: userIds },
</file context>
E2E results are ready! |
What does this PR do?
eventTypeIdanduserIdsbelong to the teamMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Summary by cubic
Restrict host removal to team-owned event types and users in the team. Adds a teamId check and filters userIds to accepted members to prevent cross-team changes.
Written for commit 16f3ebd. Summary will update automatically on new commits.