@forklaunch/core 1.0.12 → 1.1.0

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.
@@ -244,7 +244,12 @@ import { isRecord as isRecord2 } from "@forklaunch/common";
244
244
 
245
245
  // src/http/guards/hasPermissionChecks.ts
246
246
  function hasPermissionChecks(maybePermissionedAuth) {
247
- return typeof maybePermissionedAuth === "object" && maybePermissionedAuth !== null && ("allowedPermissions" in maybePermissionedAuth || "forbiddenPermissions" in maybePermissionedAuth);
247
+ if (typeof maybePermissionedAuth !== "object" || maybePermissionedAuth === null) {
248
+ return false;
249
+ }
250
+ const hasAllowedPermissions = "allowedPermissions" in maybePermissionedAuth && maybePermissionedAuth.allowedPermissions instanceof Set && maybePermissionedAuth.allowedPermissions.size > 0;
251
+ const hasForbiddenPermissions = "forbiddenPermissions" in maybePermissionedAuth && maybePermissionedAuth.forbiddenPermissions instanceof Set && maybePermissionedAuth.forbiddenPermissions.size > 0;
252
+ return hasAllowedPermissions || hasForbiddenPermissions;
248
253
  }
249
254
 
250
255
  // src/http/guards/hasRoleChecks.ts