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

chore: fix admin permission to create new omp #1747

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gitanjli525
Copy link
Contributor

@gitanjli525 gitanjli525 commented Nov 15, 2024

Type of Change

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

Description

currently merchant admins are able to click the button to create new merchant and profile admins are able to click on button to create new profiles, but the backend api throws error for the same as "Access Forbidden"

this PR disables the button click in these cases using the roleId that we are getting from user api response

image
image
image

Motivation and Context

How did you test it?

  • switch to user with merchant admin role
  • user should not be able to click on add new merchants button
  • same for profile admin not able to click on add new profile button

Where to test it?

  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@gitanjli525 gitanjli525 self-assigned this Nov 15, 2024
@gitanjli525 gitanjli525 requested a review from a team as a code owner November 15, 2024 08:59
Copy link

Review changes with  SemanticDiff

@gitanjli525 gitanjli525 added the core Status: issues related to core label Nov 15, 2024
@gitanjli525 gitanjli525 added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 15, 2024
| _ => []
}

let hasCreateNewOMPAccess = (user, roleId): CommonAuthTypes.authorization => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

use hook instead of function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Status: issues related to core S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CHORE]: fix button click permission for admin to create new merchant and profile
4 participants