Comment 10 for bug 1520299

Revision history for this message
Murali Kunda (murali-kz) wrote :

I have created below work flow to add all developers into authorised repliers.
But new issues created by fetching e-mail from Inbox have only email ID of sender in the authorised replier list.

Please suggest me if I have to do any more changes to the work flow

-------------------------------------------------------------------------------------------------------------------
<?php
require_once(APP_INC_PATH . "workflow/class.abstract_workflow_backend.php");

class AuthorisedRepliers_Workflow_Backend extends Abstract_Workflow_Backend
{
 /**
   * Allows all users with a role of developer or above to email
   *
   * @param integer $prj_id The project ID.
   * @param integer $issue_id The ID of the issue
   * @param string The email address that is trying to send an email
   * @return boolean true if the sender can email the issue, false if the sender
   * should not email the issue and null if the default rules should be used.
   */
  function canEmailIssue($prj_id, $issue_id, $email)
  {
   // get usr_id
   $usr_id = User::getUserIDByEmail($email);
   if ((!empty($usr_id)) && (User::getRoleByUser($usr_id, $prj_id) >= User::getRoleID("Developer"))) {
     return true;
   } else {
     return null;
   }
  }
}