UNPKG

@lucidcms/core

Version:

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

2 lines 973 B
import{copy as e}from"../i18n/copy.mjs";import{tenantAccessAllowed as t}from"../../utils/helpers/tenants.mjs";import{ClientScopes as n,getCollectionClientScope as r}from"./client-scopes.mjs";const i=[{key:`media`,details:{name:e(`admin:client.scopes.media.label`)},scopes:[{key:n.MediaRead,details:{name:e(`admin:client.scopes.media.read`)}},{key:n.MediaProcess,details:{name:e(`admin:client.scopes.media.process`)}}]},{key:`locales`,details:{name:e(`admin:client.scopes.locales.label`)},scopes:[{key:n.LocalesRead,details:{name:e(`admin:client.scopes.locales.read`)}}]}],a=(n,a)=>[...n.collections.filter(e=>a?.tenantKey===void 0||t(e.getData.tenants,a.tenantKey)).map(t=>({key:`documents:${t.key}`,details:{name:t.getData.details.name},scopes:[{key:r(t.key),details:{name:e(`admin:client.scopes.documents.read`)}}]})),...i],o=(e,t)=>a(e,t).flatMap(e=>e.scopes.map(e=>e.key));export{a as getClientScopeGroups,o as getValidClientScopes}; //# sourceMappingURL=scopes.mjs.map