{"version":3,"sources":["../../src/auth/extractAccessFromPermission.ts"],"sourcesContent":["import type { AccessResult } from '../config/types.js'\nimport type { Permission } from './index.js'\n\nexport const extractAccessFromPermission = (hasPermission: boolean | Permission): AccessResult => {\n if (typeof hasPermission === 'boolean') {\n return hasPermission\n }\n\n const { permission, where } = hasPermission\n if (!permission) {\n return false\n }\n if (where && typeof where === 'object') {\n return where\n }\n return true\n}\n"],"names":["extractAccessFromPermission","hasPermission","permission","where"],"mappings":"AAGA,OAAO,MAAMA,8BAA8B,CAACC;IAC1C,IAAI,OAAOA,kBAAkB,WAAW;QACtC,OAAOA;IACT;IAEA,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAE,GAAGF;IAC9B,IAAI,CAACC,YAAY;QACf,OAAO;IACT;IACA,IAAIC,SAAS,OAAOA,UAAU,UAAU;QACtC,OAAOA;IACT;IACA,OAAO;AACT,EAAC"}