UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 427 B
var e={formatMultiple:e=>{if(!e.roles)return{roles:[],permissions:[]};let t=new Set;for(let n of e.roles)if(n.permissions)for(let e of n.permissions)t.add(e.permission);return{roles:e.roles.map(({id:t,name:n,translations:r})=>({id:t,name:n??r?.find(t=>t.locale_code===e.defaultLocale)?.name??r?.find(e=>e.name!==null)?.name??``})),permissions:Array.from(t)}}};export{e as default}; //# sourceMappingURL=user-permissions.mjs.map