src/ViKon/Auth/Guard.php
public function hasRoles($roles)
    {
        if ($this->user() === null) {
            return null;
        }

        if (!is_array($roles)) {
            $roles = func_get_args();
        }

        // Count roles because user need user to have all roles passed as parameter
        return count(array_intersect($roles, $this->roles)) === count($roles);
    }
public function hasRoles($roles)
    {
        if ($this->user() === null) {
            return null;
        }

        if (!is_array($roles)) {
            $roles = func_get_args();
        }

        // Count roles because user need user to have all roles passed as parameter
        return count(array_intersect($roles, $this->roles)) === count($roles);
    }
public function hasRoles ( $ roles ) { if ( $ this -> user ( ) === null ) { return null ; } if ( ! is_array ( $ roles ) ) { $ roles = func_get_args ( ) ; } // Count roles because user need user to have all roles passed as parameter return count ( array_intersect ( $ roles , $ this -> roles ) ) === count ( $ roles ) ; }
Check if authenticated user has all roles passed by parameter

@param string[] $roles

@return bool|null return NULL if user is not authenticated
Check if authenticated user has all roles passed by parameter