feat(users): custom role at profile read#6875
Merged
Gnanasundari24 merged 48 commits intomainfrom Feb 5, 2025
Merged
Conversation
b573226
sai-harsha-vardhan
previously approved these changes
Jan 27, 2025
su-shivanshmathur
previously approved these changes
Jan 27, 2025
…ay/hyperswitch into custom-role-at-profile-read
469daa3
racnan
reviewed
Jan 31, 2025
Comment on lines
+175
to
+176
| .filter(dsl::tenant_id.eq(tenant_id)) | ||
| .filter(dsl::org_id.eq(org_id)) |
Contributor
There was a problem hiding this comment.
take these filter out of the match statement. dry!
crates/diesel_models/src/role.rs
Outdated
Comment on lines
+83
to
+89
| Profile( | ||
| id_type::OrganizationId, | ||
| id_type::MerchantId, | ||
| id_type::ProfileId, | ||
| ), | ||
| Merchant(id_type::OrganizationId, id_type::MerchantId), | ||
| Organization(id_type::OrganizationId), |
Contributor
There was a problem hiding this comment.
can organisation_id be passed as a function argument instead of inside the enum.
ThisIsMani
approved these changes
Feb 3, 2025
| } | ||
| let (org_id, merchant_id, profile_id) = match role_entity_type { | ||
| EntityType::Organization | EntityType::Tenant => { | ||
| (user_from_token.org_id, user_from_token.merchant_id, None) |
Contributor
There was a problem hiding this comment.
We should probably throw error here.
Contributor
Author
There was a problem hiding this comment.
Will take this up in the next PR
apoorvdixit88
approved these changes
Feb 4, 2025
racnan
approved these changes
Feb 4, 2025
su-shivanshmathur
approved these changes
Feb 4, 2025
sai-harsha-vardhan
approved these changes
Feb 4, 2025
Narayanbhat166
pushed a commit
that referenced
this pull request
Feb 6, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Gnanasundari24 <118818938+Gnanasundari24@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This pr adds the functionality to read custom role at profile level
Additional Changes
Motivation and Context
Closes #6488
How did you test it?
Request
Response
If a role with the same name is created either below me or in my lineage , then i wouldn't be able to create the role with that same name
Request
Response
Checklist
cargo +nightly fmt --allcargo clippy