'use strict';
import { apiForbiddenError } from '../../../fd-toolbox/server/web/errors.js';
import { getResourceMeta } from '../../meta/server/services/metas.js';
import { checkSupportedCrudActions } from '../../meta/server/services/crud-actions.js';
import { getPermissionCheckConfig } from '../../meta/server/services/permission-check-config-provider.js';
import { hasPermission } from '../../meta/server/permission/permission-checker.js';

var __defProp=Object['defineProperty'],__name=(_0x2319be,_0xbce980)=>__defProp(_0x2319be,'name',{'value':_0xbce980,'configurable':!![]});async function checkResourceAccessPermission(_0x394674,_0x36fe4d,_0x4cada0){const _0x27b2d1=await getResourceMeta(_0x36fe4d);checkSupportedCrudActions(_0x27b2d1,_0x4cada0);const _0xfc1a87=getPermissionCheckConfig(_0x394674,_0x27b2d1);if(!await hasPermission(_0xfc1a87))throw apiForbiddenError();}__name(checkResourceAccessPermission,'checkResourceAccessPermission');

export { checkResourceAccessPermission };
