function privatemsg_roles_permission in Privatemsg 7.2
Same name and namespace in other branches
- 7 privatemsg_roles/privatemsg_roles.module \privatemsg_roles_permission()
Implements hook_perm().
File
- privatemsg_roles/
privatemsg_roles.module, line 11 - Allows to send messages to all members of a role.
Code
function privatemsg_roles_permission() {
$permissions = array(
'write privatemsg to all roles' => array(
'title' => t('Write private messages to all roles'),
'description' => t('Allows to write messages to all users which belong to a specific role.'),
),
'view roles recipients' => array(
'title' => t('View roles recipients'),
'description' => t('Ability to view roles recipients and the name of these roles.'),
),
);
foreach (user_roles(TRUE) as $role) {
$permissions['write privatemsg to role ' . $role] = array(
'title' => t('Write private messages to role %role', array(
'%role' => $role,
)),
'description' => t('Allows to write messages to all users which belong to a specific role.'),
);
}
return $permissions;
}