protected function _authorizeDeleteComment($context)
    {
        $comment = $context->comment;

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

        if (isset($this->_entity->object)) {
            if (is_array($this->_entity->object)) {
                return false;
            }

            if (!$this->_entity->object->isAuthorizer()) {
                return false;
            }

            return $this->_entity->object->authorize('delete.comment');
        }

        return false;
    }
protected function _authorizeDeleteComment($context)
    {
        $comment = $context->comment;

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

        if (isset($this->_entity->object)) {
            if (is_array($this->_entity->object)) {
                return false;
            }

            if (!$this->_entity->object->isAuthorizer()) {
                return false;
            }

            return $this->_entity->object->authorize('delete.comment');
        }

        return false;
    }
protected function _authorizeDeleteComment ( $ context ) { $ comment = $ context -> comment ; //guest can't delete if ( $ this -> _viewer -> guest ( ) ) { return false ; } if ( isset ( $ this -> _entity -> object ) ) { if ( is_array ( $ this -> _entity -> object ) ) { return false ; } if ( ! $ this -> _entity -> object -> isAuthorizer ( ) ) { return false ; } return $ this -> _entity -> object -> authorize ( 'delete.comment' ) ; } return false ; }
Authoriz deleting a comment.

@param AnCommandContext $context Context parameter

@return bool
Authoriz deleting a comment .