Issue:
fix(users): Check lineage across entities in invite

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
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

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->

Closes #6679.

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
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
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible


Resolution:
<think>
PR Context:
- Title: fix(users): Check lineage across entities in invite
- Merged: 2024-11-27T14:40:31Z
- Files changed: 1 files
- Commits: 1 commits

Implementation approach:
[## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
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.
Main PR: #6677

### Additional Changes

- [ ] This PR modifies
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** fix(users): Check lineage across entities in invite (#6680)
Files to modify:


**crates/router/src/core/user.rs**
  Modify existing code