/**
  * Executes edit action.
  */
 public function executeEdit()
 {
     $id = $this->getRequestParameter('id');
     $user = $this->getUser();
     $is_moderator = $user->hasCredential(sfConfig::get('app_credentials_moderator'));
     //    FIXME : only moderators can edit a portal, waiting for correct edition right management :
     //      - for common portals, the members con edit only text fields, and data fields are editable only by moderators
     //      - for cda portal, the moderators only can edit it
     //    $cda_config = sfConfig::get('app_portals_cda');
     //    if ($is_moderator || $id != $cda_config['id'])
     if ($is_moderator) {
         parent::executeEdit();
     } else {
         return $this->ajax_feedback('You do not have enough credentials to perform this operation');
     }
 }
 public function executeEdit()
 {
     parent::executeEdit();
     // check if the image is already associated to a book (required to decide whether "copyright" is allowed or not)
     $id = $this->document['id'];
     $assocations = Association::findAllAssociations($id, 'bi');
     $this->is_associated_book = !empty($association);
 }