You are here

function commons_groups_node_insert in Drupal Commons 7.3

Implements hook_node_insert().

File

modules/commons/commons_groups/commons_groups.module, line 805

Code

function commons_groups_node_insert($node) {
  $account = user_load($node->uid);
  commons_groups_first_contribution($account, $node);
  if (og_is_group('node', $node)) {

    // When creating a new group, this hook happens before OG creates the
    // group specific roles. Therefore we create the roles here before altering
    // them in commons_groups_set_group_permissions().
    og_roles_override('node', $node->type, $node->nid);
    commons_groups_set_group_permissions($node);
  }
}