react-permissions-dynamic
Version:
This is a package with react-permissions
10 lines (9 loc) • 428 B
JavaScript
;
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;