feat: add kitchen dashboard, format codebase
This commit is contained in:
@@ -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"),
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user