vluk@2fi-solutions.com.hk 3 недель назад
Родитель
Сommit
6bf874bda8
3 измененных файлов: 12 добавлений и 6 удалений
  1. +9
    -2
      src/authorities.ts
  2. +1
    -1
      src/components/DetailedSchedule/DetailedScheduleSearchView.tsx
  3. +2
    -3
      src/components/NavigationContent/NavigationContent.tsx

+ 9
- 2
src/authorities.ts Просмотреть файл

@@ -1,7 +1,14 @@
export const [VIEW_USER, VIEW_DO, MAINTAIN_USER, VIEW_GROUP, MAINTAIN_GROUP] = [
export const [VIEW_USER,MAINTAIN_USER, VIEW_GROUP, MAINTAIN_GROUP,
TESTING, PROD, PACK, ADMIN, STOCK, Driver] = [
"VIEW_USER", "VIEW_USER",
"VIEW_DO",
"MAINTAIN_USER", "MAINTAIN_USER",
"VIEW_GROUP", "VIEW_GROUP",
"MAINTAIN_GROUP", "MAINTAIN_GROUP",
//below auth act as role
"TESTING",
"PROD",
"PACK",
"ADMIN",
"STOCK",
"Driver",
]; ];

+ 1
- 1
src/components/DetailedSchedule/DetailedScheduleSearchView.tsx Просмотреть файл

@@ -26,7 +26,7 @@ import isToday from 'dayjs/plugin/isToday';
import useUploadContext from "../UploadProvider/useUploadContext"; import useUploadContext from "../UploadProvider/useUploadContext";
import { FileDownload, CalendarMonth } from "@mui/icons-material"; import { FileDownload, CalendarMonth } from "@mui/icons-material";
import { useSession } from "next-auth/react"; import { useSession } from "next-auth/react";
import { VIEW_USER, VIEW_DO } from "@/authorities";
import { VIEW_USER } from "@/authorities";


dayjs.extend(isToday); dayjs.extend(isToday);




+ 2
- 3
src/components/NavigationContent/NavigationContent.tsx Просмотреть файл

@@ -28,12 +28,11 @@ import Logo from "../Logo";
import BugReportIcon from "@mui/icons-material/BugReport"; import BugReportIcon from "@mui/icons-material/BugReport";
import { import {
VIEW_USER, VIEW_USER,
VIEW_DO,
MAINTAIN_USER, MAINTAIN_USER,
VIEW_GROUP, VIEW_GROUP,
MAINTAIN_GROUP, MAINTAIN_GROUP,
// Add more authorities as needed, e.g.: // Add more authorities as needed, e.g.:
// VIEW_PO, MAINTAIN_PO, VIEW_INVENTORY, etc.
TESTING, PROD, PACK, ADMIN, STOCK, Driver
} from "../../authorities"; } from "../../authorities";


interface NavigationItem { interface NavigationItem {
@@ -137,7 +136,6 @@ const NavigationContent: React.FC = () => {
label: "Delivery", label: "Delivery",
path: "", path: "",
//requiredAbility: VIEW_DO, //requiredAbility: VIEW_DO,
requiredAbility: VIEW_USER,
children: [ children: [
{ {
icon: <RequestQuote />, icon: <RequestQuote />,
@@ -235,6 +233,7 @@ const NavigationContent: React.FC = () => {
icon: <BugReportIcon />, icon: <BugReportIcon />,
label: "Printer Testing", label: "Printer Testing",
path: "/testing", path: "/testing",
requiredAbility: TESTING,
isHidden: false, isHidden: false,
}, },
{ {


Загрузка…
Отмена
Сохранить