fix(setting): update hr permission
This commit is contained in:
parent
b22c9b9cc5
commit
2c94e91668
|
|
@ -149,8 +149,8 @@ Route::middleware('api')
|
||||||
'prefix' => 'category',
|
'prefix' => 'category',
|
||||||
], function () {
|
], function () {
|
||||||
Route::get('/get-list-master', [CategoryController::class, 'getListMaster']);
|
Route::get('/get-list-master', [CategoryController::class, 'getListMaster']);
|
||||||
Route::get('/work-days', [CategoryController::class, 'workDays']);
|
Route::get('/work-days', [CategoryController::class, 'workDays'])->middleware('check.permission:admin.hr');
|
||||||
Route::put('/update-work-days', [CategoryController::class, 'updateWorkDays']);
|
Route::put('/update-work-days', [CategoryController::class, 'updateWorkDays'])->middleware('check.permission:admin.hr');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group([
|
Route::group([
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,8 @@ const data = [
|
||||||
link: '/organization-settings',
|
link: '/organization-settings',
|
||||||
label: 'Organization Settings',
|
label: 'Organization Settings',
|
||||||
icon: IconSettings,
|
icon: IconSettings,
|
||||||
group: 'admin',
|
group: 'other',
|
||||||
permissions: 'admin',
|
permissions: 'admin,hr',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
link: '/profiles',
|
link: '/profiles',
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import { DatePickerInput } from '@mantine/dates'
|
||||||
import { IconInfoCircle } from '@tabler/icons-react'
|
import { IconInfoCircle } from '@tabler/icons-react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import customParseFormat from 'dayjs/plugin/customParseFormat'
|
import customParseFormat from 'dayjs/plugin/customParseFormat'
|
||||||
|
import { checkPermissionAdmin } from '@/rtk/localStorage'
|
||||||
|
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
|
|
@ -55,21 +56,21 @@ function OrganizationSettings() {
|
||||||
<Tabs w="100%" value={activeTab} onChange={setActiveTab}>
|
<Tabs w="100%" value={activeTab} onChange={setActiveTab}>
|
||||||
<Tabs.List>
|
<Tabs.List>
|
||||||
<Tabs.Tab value="work-day">Work Day Setting</Tabs.Tab>
|
<Tabs.Tab value="work-day">Work Day Setting</Tabs.Tab>
|
||||||
<Tabs.Tab value="technical">Technical Setting</Tabs.Tab>
|
|
||||||
<Tabs.Tab value="third">Setting 3</Tabs.Tab>
|
{checkPermissionAdmin('admin') && (
|
||||||
|
<Tabs.Tab value="technical">Technical Setting</Tabs.Tab>
|
||||||
|
)}
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
|
|
||||||
<Tabs.Panel value="work-day" pt="xs">
|
<Tabs.Panel value="work-day" pt="xs">
|
||||||
<WorkDaySettingTab />
|
<WorkDaySettingTab />
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
|
|
||||||
<Tabs.Panel value="technical" pt="xs">
|
{checkPermissionAdmin('admin') && (
|
||||||
<TechnicalSettingTab />
|
<Tabs.Panel value="technical" pt="xs">
|
||||||
</Tabs.Panel>
|
<TechnicalSettingTab />
|
||||||
|
</Tabs.Panel>
|
||||||
<Tabs.Panel value="third" pt="xs">
|
)}
|
||||||
Setting 3
|
|
||||||
</Tabs.Panel>
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@ const mainRoutes = [
|
||||||
{
|
{
|
||||||
path: '/organization-settings',
|
path: '/organization-settings',
|
||||||
element: (
|
element: (
|
||||||
<ProtectedRoute mode="route" permission="admin">
|
<ProtectedRoute mode="route" permission="admin,hr">
|
||||||
<BasePage
|
<BasePage
|
||||||
main={
|
main={
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue