MCPcopy Index your code
hub / github.com/WebDevSimplified/feature-flags-sample-code / userHasValidRole

Function userHasValidRole

src/lib/featureFlags.ts:44–49  ·  view source on GitHub ↗
(
  allowedRoles: UserRole[] | undefined,
  userRole: UserRole
)

Source from the content-addressed store, hash-verified

42}
43
44function userHasValidRole(
45 allowedRoles: UserRole[] | undefined,
46 userRole: UserRole
47) {
48 return allowedRoles == null || allowedRoles.includes(userRole)
49}
50
51const MAX_UINT_32 = 4294967295
52function userIsWithinPercentage(

Callers 1

checkRuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected