/** * Check if roleAction matches routeAction * * @private * * @param roleAction Action of the current role loop * @param routeAction Action required by the route * * @return {boolean} */ _matchActions (roleAction, routeAction) { const actionsKeys = chain(keys(routeAction)).concat(keys(roleAction)).uniq().value() for (const key of actionsKeys) { const roleActionValue = roleAction[key] const routeActionValue = routeAction[key] || '*' if (roleActionValue !== '*') { if (Array.isArray(roleActionValue)) { if (roleActionValue.indexOf(routeActionValue) === -1) return false } else if (roleActionValue !== routeActionValue) return false } } return true }