Example #1
0
 /**
  *	addUser - add a user to this ArtifactType - depends on UNIQUE INDEX preventing duplicates.
  *
  *	@param	int		user_id of the new user.
  *  @param  value: the value permission
  *
  *	@return boolean	success.
  */
 function addUser($id, $value)
 {
     global $Language;
     if (!$this->userIsAdmin()) {
         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_common_canned', 'perm_denied'));
         return false;
     }
     if (!$id) {
         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_common_canned', 'missing_param'));
         return false;
     }
     $perm_dao = new Tracker_PermDao();
     if ($perm_dao->createUser($id, $value, $this->getId())) {
         return true;
     } else {
         return false;
     }
 }