Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
home
/
ophq1335
/
www
/
wp-content
/
themes
/
Divi
/
core
/
code-snippets
/
app
/
lib
/
/home/ophq1335/www/wp-content/themes/Divi/core/code-snippets/app/lib/capabilities.js
// External dependencies. import { every, get, isArray, isEmpty, } from 'lodash'; // Internal dependencies. import config from './config'; const isAllowedActionPure = (capabilities, action, restrictByDefault = false) => { if (isEmpty(action)) { return true; } const defaultValue = restrictByDefault ? 'off' : 'on'; if (isArray(action)) { return every(action, action => 'on' === get(capabilities, action, defaultValue)); } return 'on' === get(capabilities, action, defaultValue); }; export const isAllowedAction = (...args) => isAllowedActionPure(config.capabilities, ...args);