Skip to content

Conversation

ThisIsMani
Copy link
Contributor

@ThisIsMani ThisIsMani commented Mar 6, 2024

Type of Change

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

Description

Currently there is no way to get the details of user and their role directly. This API solves it by taking the email of the user and returns the details.

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 #3987

How did you test it?

Postman.

curl --location 'http://localhost:8080/user/[email protected]' \
--header 'Authorization: Bearer JWT'
{
    "email": "user email",
    "name": "user name",
    "role_id": "merchant_view_only",
    "role_name": "View Only",
    "status": "Active",
    "last_modified_at": "2024-03-01T06:23:44.250Z",
    "groups": [
        "operations_view",
        "connectors_view",
        "workflows_view",
        "analytics_view",
        "users_view",
        "merchant_details_view"
    ],
    "role_scope": "organization"
}

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
  • I added a CHANGELOG entry if applicable

@ThisIsMani ThisIsMani requested review from a team as code owners March 6, 2024 12:39
@ThisIsMani ThisIsMani self-assigned this Mar 6, 2024
@ThisIsMani ThisIsMani added A-users Area: Users C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Mar 6, 2024
)
.await
.change_context(UserErrors::InternalServerError)
.attach_printable("User role exists but role doesn't")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we modify printable?

@preetamrevankar preetamrevankar added this pull request to the merge queue Mar 7, 2024
Merged via the queue into main with commit ba42fba Mar 7, 2024
@preetamrevankar preetamrevankar deleted the get-user-role branch March 7, 2024 06:37
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: get specific user role details api
6 participants