MCPcopy
hub / github.com/alan2207/bulletproof-react / requireAdmin

Function requireAdmin

apps/nextjs-app/src/testing/mocks/utils.ts:106–110  ·  view source on GitHub ↗
(user: any)

Source from the content-addressed store, hash-verified

104}
105
106export function requireAdmin(user: any) {
107 if (user.role !== 'ADMIN') {
108 throw Error('Unauthorized');
109 }
110}

Callers 2

discussions.tsFile · 0.90
users.tsFile · 0.90

Calls 1

ErrorFunction · 0.50

Tested by

no test coverage detected