diff --git a/src/screens/UserManagement/UserRevamp/UserInfo.res b/src/screens/UserManagement/UserRevamp/UserInfo.res index 4cdb4820e..86c36cd1a 100644 --- a/src/screens/UserManagement/UserRevamp/UserInfo.res +++ b/src/screens/UserManagement/UserRevamp/UserInfo.res @@ -17,7 +17,10 @@ module UserAction = { ) let decideWhatToShow = { - if userEmail === email { + if value.entityType->UserInfoUtils.entityMapper === #Organization { + // User is at org level + NoActionAccess + } else if userEmail === email { // User cannot update its own role NoActionAccess } else if userHasAccess(~groupAccess=UsersManage) === NoAccess { @@ -30,13 +33,6 @@ module UserAction = { value.profile.id->Option.getOr("") === profileId ) { ManageUser - } else if ( - // Merchant level user - value.org.id->Option.getOr("") === orgId && - value.merchant.id->Option.getOr("") === merchantId && - value.profile.id->Option.isNone - ) { - ManageUser } else if ( // Org level user value.org.id->Option.getOr("") === orgId && diff --git a/src/screens/UserManagement/UserRevamp/UserManagementHelper.res b/src/screens/UserManagement/UserRevamp/UserManagementHelper.res index 2859811ce..6e98a492d 100644 --- a/src/screens/UserManagement/UserRevamp/UserManagementHelper.res +++ b/src/screens/UserManagement/UserRevamp/UserManagementHelper.res @@ -85,7 +85,6 @@ module MerchantSelection = { ~label="All merchants", ~value="all_merchants", ~dropdownList=merchList, - ~showAllSelection=true, ), ~deselectDisable=true, ~buttonText="Select a Merchant", @@ -113,31 +112,10 @@ module ProfileSelection = { let internalSwitch = OMPSwitchHooks.useInternalSwitch() let profileList = Recoil.useRecoilValueFromAtom(HyperswitchAtom.profileListAtom) let {userInfo: {userEntity}} = React.useContext(UserInfoProvider.defaultContext) - let form = ReactFinalForm.useForm() - let formState: ReactFinalForm.formState = ReactFinalForm.useFormState( - ReactFinalForm.useFormSubscription(["values"])->Nullable.make, - ) let disableSelect = switch userEntity { | #Profile => true - | #Organization => { - let selected_merchant = - formState.values - ->LogicUtils.getDictFromJsonObject - ->LogicUtils.getString("merchant_value", "") - switch selected_merchant->stringToVariantForAllSelection { - | Some(#All_Merchants) => { - form.change( - "profile_value", - (#All_Profiles: UserManagementTypes.allSelectionType :> string) - ->String.toLowerCase - ->JSON.Encode.string, - ) - true - } - | _ => false - } - } + | #Organization | #Merchant => false }