UNPKG

react-permissions-dynamic

Version:
10 lines (9 loc) 428 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkIfAllowed = void 0; const checkIfAllowed = (actionsStatus, isAllowed, payload) => { const allowed = actionsStatus.filter(as => as.allowed).map(as => as.action); const denied = actionsStatus.filter(as => !as.allowed).map(as => as.action); return isAllowed(allowed, denied, payload); }; exports.checkIfAllowed = checkIfAllowed;