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

fix: Access Control Issue #284

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/entryPoints/hyperswitch/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ let make = () => {
/>
</AccessControl>
| list{"recon"} =>
<AccessControl isEnabled=featureFlagDetails.recon>
<AccessControl isEnabled=featureFlagDetails.recon permission=Access>
<Recon />
</AccessControl>
| list{"sdk"} =>
<AccessControl isEnabled={!featureFlagDetails.isLiveMode}>
<AccessControl isEnabled={!featureFlagDetails.isLiveMode} permission=Access>
<SDKPage />
</AccessControl>
| list{"3ds"} =>
Expand Down Expand Up @@ -397,7 +397,8 @@ let make = () => {
<BusinessDetails />
</AccessControl>
| list{"business-profiles"} =>
<AccessControl isEnabled=featureFlagDetails.businessProfile>
<AccessControl
isEnabled=featureFlagDetails.businessProfile permission=Access>
<BusinessProfile />
</AccessControl>
| list{"quick-start"} => determineQuickStartPageState()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/AccessControl.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open AuthTypes
@react.component
let make = (~isEnabled=true, ~permission=NoAccess, ~children) => {
let make = (~isEnabled=true, ~permission, ~children) => {
let isAccessAllowed = permission === Access
isEnabled && isAccessAllowed ? children : <UnauthorizedPage />
}
Loading