Skip to content

Commit

Permalink
Merge pull request #421 from bcgov/fix-reviewer-form-access
Browse files Browse the repository at this point in the history
hide forms for reviewer
  • Loading branch information
nikhila-aot authored Jul 31, 2023
2 parents 8912629 + 44f1c86 commit 24aca83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ const PrivateRoute = React.memo((props) => {
{isAuth ? (
<Suspense fallback={<Loading />}>
<Switch>
{ENABLE_FORMS_MODULE && (
{ENABLE_FORMS_MODULE && userRoles.includes(CLIENT_REVIEWER) && (
<Route
path={[`${BASE_ROUTE}form`, `${BASE_ROUTE}bundle`]}
component={Form}
/>
)}
{ENABLE_FORMS_MODULE && !userRoles.includes(STAFF_REVIEWER) && (
<Route
path={[`${BASE_ROUTE}form`, `${BASE_ROUTE}bundle`]}
component={Form}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const NavBar = React.memo(({ props }) => {
id="main-menu-nav"
className="active align-items-lg-center"
>
{ENABLE_FORMS_MODULE && (
{(getUserRolePermission(userRoles, CLIENT_REVIEWER) || !getUserRolePermission(userRoles, STAFF_REVIEWER)) ? ENABLE_FORMS_MODULE && (
<Nav.Link
as={Link}
to={`${baseUrl}form`}
Expand All @@ -205,7 +205,7 @@ const NavBar = React.memo(({ props }) => {
<i className="fa fa-wpforms fa-fw fa-lg mr-2" />
{t("Forms")}
</Nav.Link>
)}
):null}

{getUserRolePermission(userRoles, ADMIN_ROLE) ? (
<Nav.Link
Expand Down

0 comments on commit 24aca83

Please sign in to comment.