MCPcopy
hub / github.com/directus/directus / handler

Function handler

api/src/middleware/is-admin.ts:9–15  ·  view source on GitHub ↗
(req: Request, _res: Response, next: NextFunction)

Source from the content-addressed store, hash-verified

7 * Require the request to have been made by an admin
8 */
9export const handler = async (req: Request, _res: Response, next: NextFunction) => {
10 if (!isAdmin(req.accountability)) {
11 throw new ForbiddenError();
12 }
13
14 return next();
15};
16
17export default asyncHandler(handler);

Callers 15

callbackFunction · 0.50
onEventFunction · 0.50
mockSdkFunction · 0.50
emitWebSocketMessageFunction · 0.50
emitWebSocketOpenFunction · 0.50
use-collab.test.tsFile · 0.50
runOperationFlowMethod · 0.50
runWebhookFlowMethod · 0.50
executeOperationMethod · 0.50

Calls 1

isAdminFunction · 0.85

Tested by 3

emitWebSocketMessageFunction · 0.40
emitWebSocketOpenFunction · 0.40
mockClientFunction · 0.40