@forklaunch/core 0.18.4 → 0.18.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -440,7 +440,12 @@ function hasPermissionChecks(maybePermissionedAuth) {
440
440
 
441
441
  // src/http/guards/hasRoleChecks.ts
442
442
  function hasRoleChecks(maybeRoledAuth) {
443
- return typeof maybeRoledAuth === "object" && maybeRoledAuth !== null && ("allowedRoles" in maybeRoledAuth || "forbiddenRoles" in maybeRoledAuth);
443
+ if (typeof maybeRoledAuth !== "object" || maybeRoledAuth === null) {
444
+ return false;
445
+ }
446
+ const hasAllowedRoles = "allowedRoles" in maybeRoledAuth && maybeRoledAuth.allowedRoles instanceof Set && maybeRoledAuth.allowedRoles.size > 0;
447
+ const hasForbiddenRoles = "forbiddenRoles" in maybeRoledAuth && maybeRoledAuth.forbiddenRoles instanceof Set && maybeRoledAuth.forbiddenRoles.size > 0;
448
+ return hasAllowedRoles || hasForbiddenRoles;
444
449
  }
445
450
 
446
451
  // src/http/guards/hasScopeChecks.ts