From b80f0e9ffddd2f0db4120c951c671801dee1f6d5 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 18 Jan 2024 14:55:37 +0530 Subject: [PATCH] fix: revert changes --- .../HyperSwitch/UserManagement/PermissionUtils.res | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/screens/HyperSwitch/UserManagement/PermissionUtils.res b/src/screens/HyperSwitch/UserManagement/PermissionUtils.res index 36ad5080f..bf529ff77 100644 --- a/src/screens/HyperSwitch/UserManagement/PermissionUtils.res +++ b/src/screens/HyperSwitch/UserManagement/PermissionUtils.res @@ -97,13 +97,11 @@ let mapStringToPermissionType = val => { } } -let getAccessValue = (~permissionValue: array, ~permissionList) => { +let getAccessValue = (~permissionValue: permissionType, permissionList) => { open AuthTypes - let isPermissionFound = - permissionValue - ->Array.filter(permission => { - permissionList->Array.includes(permission) - }) - ->Array.length > 0 - isPermissionFound ? Access : NoAccess + let isPermissionFound = permissionList->Array.find(ele => { + ele === permissionValue + }) + + isPermissionFound->Option.isSome ? Access : NoAccess }