src/ViKon/Auth/Model/User.php
public function hasRole($role)
    {
        if (!$this->roles->where('token', $role)->isEmpty()) {
            return true;
        }

        foreach ($this->groups as $group) {
            if (!$group->roles->where('token', $role)->isEmpty()) {
                return true;
            }
        }

        return false;
    }
public function hasRole($role)
    {
        if (!$this->roles->where('token', $role)->isEmpty()) {
            return true;
        }

        foreach ($this->groups as $group) {
            if (!$group->roles->where('token', $role)->isEmpty()) {
                return true;
            }
        }

        return false;
    }
public function hasRole ( $ role ) { if ( ! $ this -> roles -> where ( 'token' , $ role ) -> isEmpty ( ) ) { return true ; } foreach ( $ this -> groups as $ group ) { if ( ! $ group -> roles -> where ( 'token' , $ role ) -> isEmpty ( ) ) { return true ; } } return false ; }
Check if user has given role

@param string $role

@return bool
Check if user has given role