protected function _authorizeDelete($context)
    {
        $ret = false;

        $comment = $this->_entity;

        //guest can't delete
        if ($this->_viewer->guest()) {
            return false;
        }

        if ($this->_viewer->admin() || $this->_viewer->eql($comment->author)) {
            return true;
        }

        //check if the parent is ownable and the parent owner authorizes administrator
        if ($this->_entity->parent->isOwnable() && $this->_entity->parent->owner->authorize('administration')) {
            return true;
        }

        return false;
    }
protected function _authorizeDelete($context)
    {
        $ret = false;

        $comment = $this->_entity;

        //guest can't delete
        if ($this->_viewer->guest()) {
            return false;
        }

        if ($this->_viewer->admin() || $this->_viewer->eql($comment->author)) {
            return true;
        }

        //check if the parent is ownable and the parent owner authorizes administrator
        if ($this->_entity->parent->isOwnable() && $this->_entity->parent->owner->authorize('administration')) {
            return true;
        }

        return false;
    }
protected function _authorizeDelete ( $ context ) { $ ret = false ; $ comment = $ this -> _entity ; //guest can't delete if ( $ this -> _viewer -> guest ( ) ) { return false ; } if ( $ this -> _viewer -> admin ( ) || $ this -> _viewer -> eql ( $ comment -> author ) ) { return true ; } //check if the parent is ownable and the parent owner authorizes administrator if ( $ this -> _entity -> parent -> isOwnable ( ) && $ this -> _entity -> parent -> owner -> authorize ( 'administration' ) ) { return true ; } return false ; }
Checks if a comment of a  node can be deleted.

@param AnCommandContext $context

@return bool
Checks if a comment of a node can be deleted .