MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / userRole

Function userRole

apps/host-selfhost/src/mcp/auth.ts:71–74  ·  view source on GitHub ↗
(user: object)

Source from the content-addressed store, hash-verified

69 * Better Auth's static base-user type, so read it through a single typed view.
70 */
71const userRole = (user: object): string | null => {
72 const role = (user as { readonly role?: unknown }).role;
73 return typeof role === "string" ? role : null;
74};
75
76const hasBearer = (request: Request): boolean =>
77 (request.headers.get("authorization") ?? "").startsWith("Bearer ");

Callers 1

principalFromUserIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected