src/View/Helper/AuthHelper.php
protected function _checkRoles($requestedRole, $roles) {
		if (is_string($roles)) {
			$roles = [$roles];
		}
		if (is_string($requestedRole)) {
			$requestedRole = [$requestedRole];
		}
		if (!is_array($requestedRole)) {
			throw new InvalidArgumentException('The requested role is not a string or an array!');
		}
		$result = array_intersect($roles, $requestedRole);

		return (count($result) > 0);
	}
protected function _checkRoles($requestedRole, $roles) {
		if (is_string($roles)) {
			$roles = [$roles];
		}
		if (is_string($requestedRole)) {
			$requestedRole = [$requestedRole];
		}
		if (!is_array($requestedRole)) {
			throw new InvalidArgumentException('The requested role is not a string or an array!');
		}
		$result = array_intersect($roles, $requestedRole);

		return (count($result) > 0);
	}
protected function _checkRoles ( $ requestedRole , $ roles ) { if ( is_string ( $ roles ) ) { $ roles = [ $ roles ] ; } if ( is_string ( $ requestedRole ) ) { $ requestedRole = [ $ requestedRole ] ; } if ( ! is_array ( $ requestedRole ) ) { throw new InvalidArgumentException ( 'The requested role is not a string or an array!' ) ; } $ result = array_intersect ( $ roles , $ requestedRole ) ; return ( count ( $ result ) > 0 ) ; }
Checks the roles.

@param string|array $requestedRole Requested role
@param string|array $roles List of roles
@return bool
Checks the roles .