/**
  * The place to check if the data set in the snippet is valid
  * to generate the snippet.
  *
  * When invalid data should result in an error, you can throw it
  * here but you can also perform the check in the
  * checkRegistryRequestsAnswers() function from the
  * {@see \MUtil_Registry_TargetInterface}.
  *
  * @return boolean
  */
 public function hasHtmlOutput()
 {
     $model = $this->getModel();
     $data = $model->loadFirst();
     $roles = $this->currentUser->getAllowedRoles();
     //\MUtil_Echo::track($data);
     // Perform access check here, before anything has happened!!!
     if (isset($data['ggp_role']) && !isset($roles[$data['ggp_role']])) {
         $this->addMessage($this->_('You do not have sufficient privilege to edit this group.'));
         $this->afterSaveRouteUrl = array($this->request->getActionKey() => 'show');
         $this->resetRoute = false;
         return false;
     }
     $this->menu->getParameterSource()->offsetSet('ggp_role', $data['ggp_role']);
     return parent::hasHtmlOutput();
 }