MCPcopy Create free account
hub / github.com/ShipSecAI/studio / normalizeRole

Function normalizeRole

frontend/src/utils/auth.ts:4–15  ·  view source on GitHub ↗
(role: string)

Source from the content-addressed store, hash-verified

2 * Normalize a role name by removing common prefixes (ORG:, ORG_, etc.)
3 */
4export function normalizeRole(role: string): string {
5 let normalized = role.toUpperCase();
6 // Remove "ORG:" prefix if present
7 if (normalized.startsWith('ORG:')) {
8 normalized = normalized.substring(4);
9 }
10 // Remove "ORG_" prefix if present
11 if (normalized.startsWith('ORG_')) {
12 normalized = normalized.substring(4);
13 }
14 return normalized;
15}
16
17/**
18 * Check if a user has admin role

Callers 1

hasAdminRoleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected