/**
  * checks wether a user may invoke a command or not
  * (this method is called by ilAccessHandler::checkAccess)
  *
  * @param	string		$a_cmd		command (not permission!)
  * @param	string		$a_permission	permission
  * @param	int			$a_ref_id	reference id
  * @param	int			$a_obj_id	object id
  * @param	int			$a_user_id	user id (if not provided, current user is taken)
  *
  * @return	boolean		true, if everything is ok
  */
 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
 {
     global $rbacsystem;
     // Set offline if no valid link exists
     if ($a_permission == 'read') {
         if (!self::_getFirstLink($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
             return false;
         }
     }
     if ($a_cmd == "settings") {
         if (self::_checkDirectLink($a_obj_id)) {
             return false;
         }
     }
     return parent::_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id);
 }
 function _construct()
 {
     parent::__construct();
 }
 /**
  * initialisation
  *
  * this method should be overwritten by derived classes
  */
 function init()
 {
     // Create static links for default command (linked title) or not
     $this->static_link_enabled = true;
     $this->delete_enabled = true;
     $this->cut_enabled = true;
     $this->subscribe_enabled = true;
     $this->link_enabled = false;
     $this->copy_enabled = false;
     $this->payment_enabled = false;
     $this->progress_enabled = false;
     $this->notice_properties_enabled = true;
     $this->info_screen_enabled = false;
     $this->type = "";
     // "cat", "course", ...
     $this->gui_class_name = "";
     // "ilobjcategorygui", "ilobjcoursegui", ...
     // general commands array, e.g.
     include_once './Services/Object/classes/class.ilObjectAccess.php';
     $this->commands = ilObjectAccess::_getCommands();
 }