CakeDC\Users\Auth\SimpleRbacAuthorize::_matchOrAsterisk PHP Method

_matchOrAsterisk() protected method

Check if rule matched or '*' present in rule matching anything
protected _matchOrAsterisk ( string | array $possibleValues, string | mixed | null $value, boolean $allowEmpty = false ) : boolean
$possibleValues string | array Values that are accepted (from permission config)
$value string | mixed | null Value to check with. We'll check the DASHERIZED value too
$allowEmpty boolean If true and $value is null, the rule will pass
return boolean
    protected function _matchOrAsterisk($possibleValues, $value, $allowEmpty = false)
    {
        $possibleArray = (array) $possibleValues;
        if ($allowEmpty && empty($possibleArray) && $value === null) {
            return true;
        }
        if ($possibleValues === '*' || in_array($value, $possibleArray) || in_array(Inflector::camelize($value, '-'), $possibleArray)) {
            return true;
        }
        return false;
    }