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

fix(users): Check lineage across entities in invite #6677

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Conversation

ThisIsMani
Copy link
Contributor

@ThisIsMani ThisIsMani commented Nov 27, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Currently in invites we don't check if user exists across entities.
This will be a problem when inviting a user with higher entity from different lineage.
This PR fixes it.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #6679.

How did you test it?

  1. Invite a user in a specific (org, merchant, profile) combination.
  2. Create a new profile in the same merchant account and switch to it.
  3. Invite the same user as merchant level user. This should be stopped by API.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@ThisIsMani ThisIsMani self-assigned this Nov 27, 2024
Copy link

semanticdiff-com bot commented Nov 27, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/user.rs  0% smaller

@ThisIsMani ThisIsMani added C-bug Category: Bug A-users Area: Users labels Nov 27, 2024
@ThisIsMani ThisIsMani marked this pull request as ready for review November 27, 2024 13:09
@ThisIsMani ThisIsMani requested a review from a team as a code owner November 27, 2024 13:09
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit f3424b7 Nov 27, 2024
15 of 17 checks passed
@Gnanasundari24 Gnanasundari24 deleted the invite-fix branch November 27, 2024 14:33
pixincreate added a commit that referenced this pull request Nov 28, 2024
…ed-cypress

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.11.28.0
  ci(cypress): Move MIT requests to configs and add Paybox Mandates (#6650)
  refactor(core): add error handling wrapper to wehbook (#6636)
  fix(users): Check lineage across entities in invite (#6677)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(users): Check lineage across entities in invite
5 participants