public function getIdentityRoles()
    {
        if (!$identity = $this->getIdentity()) {
            return $this->convertRoles([$this->guestRole]);
        }

        if (!$identity instanceof IdentityInterface) {
            throw new Exception\RuntimeException(sprintf(
                'ZfcRbac expects your identity to implement ZfcRbac\Identity\IdentityInterface, "%s" given',
                is_object($identity) ? get_class($identity) : gettype($identity)
            ));
        }

        return $this->convertRoles($identity->getRoles());
    }
public function getIdentityRoles()
    {
        if (!$identity = $this->getIdentity()) {
            return $this->convertRoles([$this->guestRole]);
        }

        if (!$identity instanceof IdentityInterface) {
            throw new Exception\RuntimeException(sprintf(
                'ZfcRbac expects your identity to implement ZfcRbac\Identity\IdentityInterface, "%s" given',
                is_object($identity) ? get_class($identity) : gettype($identity)
            ));
        }

        return $this->convertRoles($identity->getRoles());
    }
public function getIdentityRoles ( ) { if ( ! $ identity = $ this -> getIdentity ( ) ) { return $ this -> convertRoles ( [ $ this -> guestRole ] ) ; } if ( ! $ identity instanceof IdentityInterface ) { throw new Exception \ RuntimeException ( sprintf ( 'ZfcRbac expects your identity to implement ZfcRbac\Identity\IdentityInterface, "%s" given' , is_object ( $ identity ) ? get_class ( $ identity ) : gettype ( $ identity ) ) ) ; } return $ this -> convertRoles ( $ identity -> getRoles ( ) ) ; }
Get the identity roles from the current identity, applying some more logic

@return RoleInterface[]
@throws Exception\RuntimeException
Get the identity roles from the current identity applying some more logic