feat: add kitchen dashboard, format codebase

This commit is contained in:
2025-12-02 17:00:17 +01:00
parent 2a9956c3e6
commit 5ce1b4728b
82 changed files with 5206 additions and 3134 deletions

View File

@@ -1,18 +1,18 @@
import type { Access } from 'payload'
import type { Access } from "payload";
import { getUserTenantIDs } from '../../../utilities/getUserTenantIDs'
import { isSuperAdmin } from '@/access/isSuperAdmin'
import { isAccessingSelf } from './isAccessingSelf'
import { getUserTenantIDs } from "../../../utilities/getUserTenantIDs";
import { isSuperAdmin } from "@/access/isSuperAdmin";
import { isAccessingSelf } from "./isAccessingSelf";
export const updateAndDeleteAccess: Access = ({ req, id }) => {
const { user } = req
const { user } = req;
if (!user) {
return false
return false;
}
if (isSuperAdmin(user) || isAccessingSelf({ user, id })) {
return true
return true;
}
/**
@@ -24,8 +24,8 @@ export const updateAndDeleteAccess: Access = ({ req, id }) => {
* from their own tenant in the tenants array.
*/
return {
'tenants.tenant': {
in: getUserTenantIDs(user, 'admin'),
"tenants.tenant": {
in: getUserTenantIDs(user, "admin"),
},
}
}
};
};