src/Auth/AuthUserTrait.php
public function hasRole($expectedRole, $providedRoles = null) {
		if ($providedRoles !== null) {
			$roles = (array)$providedRoles;
		} else {
			$roles = $this->roles();
		}

		if (!$roles) {
			return false;
		}

		if (array_key_exists($expectedRole, $roles) || in_array($expectedRole, $roles)) {
			return true;
		}
		return false;
	}
public function hasRole($expectedRole, $providedRoles = null) {
		if ($providedRoles !== null) {
			$roles = (array)$providedRoles;
		} else {
			$roles = $this->roles();
		}

		if (!$roles) {
			return false;
		}

		if (array_key_exists($expectedRole, $roles) || in_array($expectedRole, $roles)) {
			return true;
		}
		return false;
	}
public function hasRole ( $ expectedRole , $ providedRoles = null ) { if ( $ providedRoles !== null ) { $ roles = ( array ) $ providedRoles ; } else { $ roles = $ this -> roles ( ) ; } if ( ! $ roles ) { return false ; } if ( array_key_exists ( $ expectedRole , $ roles ) || in_array ( $ expectedRole , $ roles ) ) { return true ; } return false ; }
Check if the current session has this role.

@param mixed $expectedRole
@param mixed|null $providedRoles
@return bool Success
Check if the current session has this role .