{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/plugins/admin/has-permission.mjs\";(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var has_permission_exports={};__export(has_permission_exports,{hasPermission:()=>hasPermission});module.exports=__toCommonJS(has_permission_exports);var import_statement=require(\"./access/statement.mjs\");var import_access=require(\"./access/index.mjs\");const hasPermission=__name(input=>{if(input.userId&&input.options?.adminUserIds?.includes(input.userId))return true;if(!input.permissions)return false;const roles=(input.role||input.options?.defaultRole||\"user\").split(\",\");const acRoles=input.options?.roles||import_statement.defaultRoles;for(const role of roles)if(acRoles[role]?.authorize(input.permissions)?.success)return true;return false},\"hasPermission\");0&&(module.exports={hasPermission});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,0KAA6B,kCAC7B,kBAAO,8BAGP,MAAM,cAAgB,OAAC,OAAU,CAChC,GAAI,MAAM,QAAU,MAAM,SAAS,cAAc,SAAS,MAAM,MAAM,EAAG,MAAO,MAChF,GAAI,CAAC,MAAM,YAAa,MAAO,OAC/B,MAAM,OAAS,MAAM,MAAQ,MAAM,SAAS,aAAe,QAAQ,MAAM,GAAG,EAC5E,MAAM,QAAU,MAAM,SAAS,OAAS,8BACxC,UAAW,QAAQ,MAAO,GAAK,QAAQ,IAAI,GAAG,UAAU,MAAM,WAAW,GAAI,QAAS,MAAO,MAC7F,MAAO,MACR,EAPsB","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/plugins/admin/has-permission.mjs"],"sourcesContent":[null]}}