You are here

function mass_contact_perm in Mass Contact 6

Same name and namespace in other branches
  1. 5.2 mass_contact.module \mass_contact_perm()
  2. 5 mass_contact.module \mass_contact_perm()

Implementation of hook_perm().

File

./mass_contact.module, line 52
This is the main code file for the Mass Contact module. This module enables users to contact multiple users through selected roles.

Code

function mass_contact_perm() {
  $permissions = array(
    'administer mass contact',
    'choose whether to archive mass contact messages',
    'send mass contact attachments',
    'send mass contact e-mails',
  );
  $result = db_query('SELECT category FROM {mass_contact}');
  while ($category = db_fetch_object($result)) {
    $permissions[] = 'send to users in the ' . check_plain($category->category) . ' category';
  }
  return $permissions;
}