'use strict';
import { notifyPermissionError } from '../../../../fd-toolbox/auth/permissions/permission-notifiers.js';
import { hasCrudPermission, isBelowLevelCouldBeAllowedByUserId } from '../../auth/permissions/permission-checker.js';

var __defProp=Object['defineProperty'],__name=(_0x5459ae,_0x5ebe49)=>__defProp(_0x5459ae,'name',{'value':_0x5ebe49,'configurable':!![]});function checkAndNotifyCrudPermission(_0x3a8b8b,_0x2674b5,_0x531abe){const _0x10f3b6=hasCrudPermission(_0x3a8b8b,_0x2674b5,_0x531abe);return !_0x10f3b6&&notifyCrudPermissionError(_0x3a8b8b),_0x10f3b6;}__name(checkAndNotifyCrudPermission,'checkAndNotifyCrudPermission');function checkAndNotifyCrudPermissionLessRestrictive(_0x5c1946,_0x37bfff){const _0x48bbf6=hasCrudPermission(_0x5c1946,_0x37bfff)||isBelowLevelCouldBeAllowedByUserId(_0x5c1946,_0x37bfff);return !_0x48bbf6&&notifyCrudPermissionError(_0x5c1946),_0x48bbf6;}__name(checkAndNotifyCrudPermissionLessRestrictive,'checkAndNotifyCrudPermissionLessRestrictive');function notifyCrudPermissionError(_0x3abe76){notifyPermissionError('You\x20don\x27t\x20have\x20permission\x20to\x20perform\x20this\x20action:\x20'+_0x3abe76);}__name(notifyCrudPermissionError,'notifyCrudPermissionError');

export { checkAndNotifyCrudPermission, checkAndNotifyCrudPermissionLessRestrictive };
