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

hotfix: access fixed, only employer can enter acquirement #23

Merged
merged 1 commit into from
Jan 25, 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
6 changes: 3 additions & 3 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const VOUCHER_RIGHT_SEARCH = 204001;
export const EMPLOYER_RIGHT_SEARCH = 204001;
export const EMPLOYER_RIGHT_SEARCH = 203000;
export const VOUCHER_PRICE_MANAGEMENT_RIGHT = 205001;
export const INSPECTOR_RIGHT = 101301;
export const ADMIN_RIGHT = 101103;
export const INSPECTOR_RIGHT = 204005;
export const ADMIN_RIGHT = 204004;
export const MODULE_NAME = 'workerVoucher';

export const REF_ROUTE_WORKER_VOUCHER = 'workerVoucher.route.workerVoucher';
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ const DEFAULT_CONFIG = {
{
path: ROUTE_WORKER_VOUCHER_ACQUIREMENT,
component: VoucherAcquirementPage,
requiredRights: [VOUCHER_RIGHT_SEARCH],
requiredRights: [EMPLOYER_RIGHT_SEARCH],
},
{
path: ROUTE_WORKER_VOUCHER_ASSIGNMENT,
component: VoucherAssignmentPage,
requiredRights: [EMPLOYER_RIGHT_SEARCH],
requiredRights: [VOUCHER_RIGHT_SEARCH],
},
{
path: ROUTE_WORKER_VOUCHER_PRICE_MANAGEMENT,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/VoucherAssignmentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useSelector } from 'react-redux';
import { makeStyles } from '@material-ui/styles';

import { Helmet, useModulesManager, useTranslations } from '@openimis/fe-core';
import { EMPLOYER_RIGHT_SEARCH, MODULE_NAME } from '../constants';
import { MODULE_NAME, VOUCHER_RIGHT_SEARCH } from '../constants';
import VoucherAssignmentForm from '../components/VoucherAssignmentForm';

export const useStyles = makeStyles((theme) => ({
Expand All @@ -18,7 +18,7 @@ function VoucherAssignmentPage() {
const rights = useSelector((state) => state.core?.user?.i_user?.rights ?? []);

return (
rights.includes(EMPLOYER_RIGHT_SEARCH) && (
rights.includes(VOUCHER_RIGHT_SEARCH) && (
<div className={classes.page}>
<Helmet title={formatMessage('workerVoucher.menu.voucherAssignment')} />
<VoucherAssignmentForm />
Expand Down
Loading