Skip to content

Commit

Permalink
chore: added required tenant user checks (#2008)
Browse files Browse the repository at this point in the history
Co-authored-by: Gitanjli Chopra <[email protected]>
  • Loading branch information
gitanjli525 and Gitanjli Chopra authored Jan 3, 2025
1 parent c009366 commit 8144ae1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/entryPoints/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ let make = () => {
| list{"customers", ...remainingPath} =>
<AccessControl
authorization={userHasAccess(~groupAccess=OperationsView)}
isEnabled={[#Organization, #Merchant]->checkUserEntity}>
isEnabled={[#Tenant, #Organization, #Merchant]->checkUserEntity}>
<EntityScaffold
entityName="Customers"
remainingPath
Expand All @@ -216,7 +216,7 @@ let make = () => {
| list{"analytics-user-journey"} =>
<AccessControl
isEnabled={featureFlagDetails.userJourneyAnalytics &&
[#Organization, #Merchant]->checkUserEntity}
[#Tenant, #Organization, #Merchant]->checkUserEntity}
authorization={userHasAccess(~groupAccess=AnalyticsView)}>
<FilterContext key="UserJourneyAnalytics" index="UserJourneyAnalytics">
<UserJourneyAnalytics />
Expand All @@ -225,7 +225,7 @@ let make = () => {
| list{"analytics-authentication"} =>
<AccessControl
isEnabled={featureFlagDetails.authenticationAnalytics &&
[#Organization, #Merchant]->checkUserEntity}
[#Tenant, #Organization, #Merchant]->checkUserEntity}
authorization={userHasAccess(~groupAccess=AnalyticsView)}>
<FilterContext
key="AuthenticationAnalytics" index="AuthenticationAnalytics">
Expand Down
2 changes: 1 addition & 1 deletion src/entryPoints/SidebarValues.res
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ let reconConfigurator = {
// }

let reconAndSettlement = (recon, isReconEnabled, checkUserEntity, userHasResourceAccess) => {
switch (recon, isReconEnabled, checkUserEntity([#Merchant, #Organization])) {
switch (recon, isReconEnabled, checkUserEntity([#Merchant, #Organization, #Tenant])) {
| (true, true, true) => {
let links = []
if userHasResourceAccess(~resourceAccess=ReconFiles) == CommonAuthTypes.Access {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/OMPSwitch/OMPSwitchUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ let profile = {
}

let transactionViewList = (~checkUserEntity): ompViews => {
if checkUserEntity([#Merchant, #Organization]) {
if checkUserEntity([#Tenant, #Merchant, #Organization]) {
[merchant, profile]
} else {
[]
}
}

let analyticsViewList = (~checkUserEntity): ompViews => {
if checkUserEntity([#Organization]) {
if checkUserEntity([#Tenant, #Organization]) {
[org, merchant, profile]
} else if checkUserEntity([#Merchant]) {
[merchant, profile]
Expand Down
8 changes: 6 additions & 2 deletions src/screens/UserManagement/UserRevamp/InviteMember.res
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ let make = (~isInviteUserFlow=true, ~setNewRoleSelected=_ => ()) => {

let initialvalue = [("org_value", orgId->JSON.Encode.string)]

if userEntity == #Organization {
// TODO : Change this condition when user org level user_invite is enabled
if userEntity == #Tenant {
initialvalue->Array.pushMany([
("merchant_value", merchantId->JSON.Encode.string),
("profile_value", profileId->JSON.Encode.string),
])
} else if userEntity == #Organization {
initialvalue->Array.pushMany([
("merchant_value", merchantId->JSON.Encode.string),
("profile_value", profileId->JSON.Encode.string),
Expand Down

0 comments on commit 8144ae1

Please sign in to comment.