You are here

function ggroup_group_permission in Group 7

Implements hook_group_permission().

Adds permissions for creating subgroups.

File

modules/ggroup/ggroup.group.inc, line 12
Hook implementations for the Group module.

Code

function ggroup_group_permission() {
  $permissions = array();

  // Set permissions for the enabled subgroup types.
  foreach (group_types() as $group_type) {
    $permissions["create {$group_type->name} group"] = array(
      'title' => t('Create %group_type as a subgroup', array(
        '%group_type' => $group_type
          ->label(),
      )),
      'warning' => t("This only grants the permission to create subgroups of this type.<br />Which group types can actually become subgroups is configured under every group type's config link."),
    );
  }
  return $permissions;
}