'use strict';
import { createError } from '../../../../../fd-toolbox/errors/errors.js';
import { metaErrorMessages } from '../../../constants/meta-error-messages-constants.js';
import { hasPermission, hasPropertyPermissionAsync } from '../../permission/permission-checker.js';
import { getPermissionCheckConfig } from '../../services/permission-check-config-provider.js';

var __defProp=Object['defineProperty'],__name=(_0x4677bc,_0x43a5d7)=>__defProp(_0x4677bc,'name',{'value':_0x43a5d7,'configurable':!![]});async function checkResourcePermission(_0x322139,_0x38259a,_0x524224,_0x15521a){const _0x32d30b=getPermissionCheckConfig(_0x524224,_0x322139,_0x15521a,_0x38259a);if(!await hasPermission(_0x32d30b)){const _0x18f7fe=metaErrorMessages['missingResourcePermissionException']['replace']('{0}',_0x322139['resourceName'])['replace']('{1}',_0x524224)['replace']('{2}',_0x38259a['toString']())['toString']();throw createError(_0x18f7fe);}}__name(checkResourcePermission,'checkResourcePermission');async function checkPropertyPermission(_0x4bf5d4,_0x2794fe,_0x78b93c,_0x21e47a,_0x12b1ff){const _0x5450ee=getPermissionCheckConfig(_0x78b93c,_0x4bf5d4,_0x21e47a,_0x2794fe);if(!await hasPropertyPermissionAsync(_0x12b1ff,_0x5450ee)){const _0x461256=metaErrorMessages['missingPropertyPermissionException']['replace']('{0}',_0x12b1ff)['replace']('{1}',_0x4bf5d4['resourceName'])['replace']('{2}',_0x78b93c)['replace']('{3}',_0x2794fe['toString']())['toString']();throw createError(_0x461256);}}__name(checkPropertyPermission,'checkPropertyPermission');

export { checkPropertyPermission, checkResourcePermission };
