{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/plugins/organization/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 permission_exports={};__export(permission_exports,{cacheAllRoles:()=>cacheAllRoles,hasPermissionFn:()=>hasPermissionFn});module.exports=__toCommonJS(permission_exports);const hasPermissionFn=__name((input,acRoles)=>{if(!input.permissions)return false;const roles=input.role.split(\",\");const creatorRole=input.options.creatorRole||\"owner\";const isCreator=roles.includes(creatorRole);const allowCreatorsAllPermissions=input.allowCreatorAllPermissions||false;if(isCreator&&allowCreatorsAllPermissions)return true;for(const role of roles)if(acRoles[role]?.authorize(input.permissions)?.success)return true;return false},\"hasPermissionFn\");const cacheAllRoles=new Map;0&&(module.exports={cacheAllRoles,hasPermissionFn});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,6KACA,MAAM,gBAAkB,QAAC,MAAO,UAAY,CAC3C,GAAI,CAAC,MAAM,YAAa,MAAO,OAC/B,MAAM,MAAQ,MAAM,KAAK,MAAM,GAAG,EAClC,MAAM,YAAc,MAAM,QAAQ,aAAe,QACjD,MAAM,UAAY,MAAM,SAAS,WAAW,EAC5C,MAAM,4BAA8B,MAAM,4BAA8B,MACxE,GAAI,WAAa,4BAA6B,MAAO,MACrD,UAAW,QAAQ,MAAO,GAAK,QAAQ,IAAI,GAAG,UAAU,MAAM,WAAW,GAAI,QAAS,MAAO,MAC7F,MAAO,MACR,EATwB,mBAUxB,MAAM,cAAgC,IAAI","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/plugins/organization/permission.mjs"],"sourcesContent":[null]}}