function engagements_perm

6.x engagements.module engagements_perm()

File

modules/engagements/engagements.module, line 2468
This is the primary module file for the engagements module.

Code

function engagements_perm() 
 {
  $rtn = array(
    'administer_engagements' => array(
      'title' => 'Administer Engagements',
      'description' => t('The user can edit the system config settings for the Engagements module.  Only give to admin users.'),
      "admin_restricted" => TRUE, // means only appears for admin (user_id == 1)
    ),
    'can_view_engagements' => array(
      'title' => 'Can view Engagements',
      'description' => t('The user may view engagements (only "everyone" by default)'),
    ),
    'can_view_faculty_engagements' => array(
      'title' => 'View "Faculty/Staff" Engagements',
      'description' => t('The user is allowed to view engagements marked visible for "Faculty/Staff".'),
    ),
    'can_send_email_engagements' => array(
      'title' => t('Can send email engagements to students'),
    ),
    'can_log_engagements' => array(
      'title' => t('Can log engagements with students'),
    ),
    'can_send_txt_engagements' => array(
      'title' => t('Can send txt message engagements to students'),
      'description' => t("<b>Important:</b> Be sure to also select the specific phone number/permissions below."),
    ),
  );

  // set up other permissions for each SMS line we have.
  $phones = engagements_get_from_phones();
  foreach ($phones ['lines'] as $num => $details) {
    $pretty_num = engagements_convert_to_pretty_phone_number($num);
    $desc = filter_markup($details ['description'], "plain");
    $desc = str_replace("'", "", $desc);
    $desc = str_replace('"', "", $desc);

    $rtn ["can_send_sms_from_$num"] = array(
      "title" => t("Can send txt messages from @pretty", array("@pretty" => $pretty_num)),
      "description" => t("The user may send SMS (txt) messages from @pretty - %desc phone line.", array("@pretty" => $pretty_num, "%desc" => $desc)),
    );
  }

  $rtn ['can_send_mass_sms'] = array(
    'title' => t("Send mass txt messages"),
    'description' => t("The user may access and send mass SMS (txt) messages to lists of recipients from the designated mass text lines.  
                        Only give to trusted users."),
  );


  return $rtn;
}