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

Function userRole

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

Source from the content-addressed store, hash-verified

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

Callers 1

principalFromUserIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected