Initial approach where I replaced all the entries for checkAccess

This commit is contained in:
Joao Ramos
2024-07-25 09:13:13 +01:00
parent 19d16c9cef
commit f6b4d6ad52
7 changed files with 3435 additions and 2720 deletions

View File

@@ -16,6 +16,7 @@ import ShortUniqueId from "short-unique-id";
import Button from "../Low/Button";
import Input from "../Low/Input";
import Select from "../Low/Select";
import { checkAccess } from "@/utils/permissions";
interface Props {
user: User;
@@ -137,13 +138,13 @@ export default function TicketDisplay({ user, ticket, onClose }: Props) {
options={[
{ value: "me", label: "Assign to me" },
...users
.filter((x) => ["admin", "developer", "agent"].includes(x.type))
.filter((x) => checkAccess(x, ["admin", "developer", "agent"]))
.map((u) => ({
value: u.id,
label: `${u.name} - ${u.email}`,
})),
]}
disabled={user.type === "agent"}
disabled={checkAccess(user, ["agent"])}
value={
assignedTo
? {