Skip to content
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

Added a condition to determine whether the user is a member of the team #97

Closed
wants to merge 1 commit into from

Conversation

PahaKoha
Copy link

No description provided.

@slaveeks
Copy link
Member

image

/**
* Checking if user is part of the team
*/
if (userId !== teamMemberId) {
Copy link
Member

Choose a reason for hiding this comment

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

non-creator user will never pass there, because previous if will reject him

@@ -30,4 +30,13 @@ export default async function userInTeam(request: FastifyRequest, reply: Fastify
if (creatorId !== userId) {
return await reply.forbidden();
}

const { teamMemberId } = request;
Copy link
Member

Choose a reason for hiding this comment

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

you need to add this property to request (if it is required for most requests), or access domain service from there

@PahaKoha PahaKoha closed this Oct 27, 2023
@PahaKoha PahaKoha deleted the checkTeamMember branch October 27, 2023 14:21
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.

3 participants