You are here

function group_permission in Group 7

Implements hook_permission().

1 string reference to 'group_permission'
group_hook_info in ./group.module
Implements hook_hook_info().

File

./group.module, line 110
Main module code for the Group project.

Code

function group_permission() {
  $permissions = array(
    'configure group module' => array(
      'title' => t('Configure Group module'),
      'description' => t('Configure group types, group roles, member fields, etc.'),
      'restrict access' => TRUE,
    ),
    'bypass group access' => array(
      'title' => t('Bypass group access control'),
      'description' => t('View, edit and delete all groups regardless of permission restrictions'),
      'restrict access' => TRUE,
    ),
    'access group overview' => array(
      'title' => t('Access the group overview page'),
      'warning' => t('Note: Anonymous users cannot join groups, even if you allow them to create one.'),
    ),
  );

  // Generate group creation permissions.
  foreach (group_types() as $name => $group_type) {
    $permissions["create {$name} group"] = array(
      'title' => t('%type_name: Create new group', array(
        '%type_name' => $group_type
          ->label(),
      )),
    );
  }
  return $permissions;
}