Skip to content

Commit

Permalink
fix: do not check ACL VIEW_HIERARCHY when access the Browse page
Browse files Browse the repository at this point in the history
  • Loading branch information
PenghaiZhang committed May 29, 2024
1 parent 2f859a1 commit 4a1abdb
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions react-front-end/tsrc/mainui/IndexPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,17 @@ export default function IndexPage() {

// When the legacy path doesn't have query param 'topic or when it has but the value
// is 'ALL', render 'BrowseHierarchyPage'.
return renderProtectedPage(
routeProps,
const page =
topic === null || LegacyBrowseHierarchyLiteral.is(topic)
? BrowseHierarchyPage
: RootHierarchyPage,
[isHierarchyPageACLGranted, isViewHierarchyTopicACLGranted],
);
? renderProtectedPage(routeProps, BrowseHierarchyPage, [
isHierarchyPageACLGranted,
])
: renderProtectedPage(routeProps, RootHierarchyPage, [
isHierarchyPageACLGranted,
isViewHierarchyTopicACLGranted,
]);

return page;
}}
/>
<Route render={renderLegacyContent} />
Expand Down

0 comments on commit 4a1abdb

Please sign in to comment.