@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 794 B
JavaScript
import{copy as e}from"../../../libs/i18n/copy.mjs";import t from"../../../libs/repositories/documents.mjs";import{getTableNames as n}from"../../../libs/collection/schema/runtime/runtime-schema-selectors.mjs";const r=async(r,i)=>{let a=Array.from(new Set(i.ids??(i.id===void 0?[]:[i.id])));if(a.length===0)return{error:void 0,data:void 0};let o=await n(r,i.collectionKey);if(o.error)return o;let s=await new t(r.db.client,r.config.db).selectMultipleValidationIds({ids:a,tenantKey:r.request.tenantKey,validation:{enabled:!0}},{tableName:o.data.document});return s.error?s:s.data.length===a.length?{error:void 0,data:void 0}:{error:{type:`basic`,message:e(`server:core.documents.not.found.message`),status:404},data:void 0}};export{r as default};
//# sourceMappingURL=check-document-access.mjs.map