protected function _authorizeDelete(AnCommandContext $context)
    {
        //if viewer same as the person whose profile being vieweed and viewer is a super admin don't allow to delete
        if ($this->_viewer->eql($this->_entity) && $this->_entity->superadmin()) {
            return false;
        }

        return parent::_authorizeDelete($context);
    }
protected function _authorizeDelete(AnCommandContext $context)
    {
        //if viewer same as the person whose profile being vieweed and viewer is a super admin don't allow to delete
        if ($this->_viewer->eql($this->_entity) && $this->_entity->superadmin()) {
            return false;
        }

        return parent::_authorizeDelete($context);
    }
protected function _authorizeDelete ( AnCommandContext $ context ) { //if viewer same as the person whose profile being vieweed and viewer is a super admin don't allow to delete if ( $ this -> _viewer -> eql ( $ this -> _entity ) && $ this -> _entity -> superadmin ( ) ) { return false ; } return parent :: _authorizeDelete ( $ context ) ; }
Check if a person can be deleted by the viewer.

@param AnCommandContext $context Context parameter

@return bool
Check if a person can be deleted by the viewer .