You are here

function opigno_og_access_entity_update in Opigno 7

File

modules/opigno_og_access/opigno_og_access.module, line 160
Enable access control for private and public groups and group content.

Code

function opigno_og_access_entity_update($entity, $entity_type) {
  if ($entity_type == "node" && ($entity->type == "course" || $entity->type == "class")) {
    $entity->{OG_DEFAULT_ACCESS_FIELD}[LANGUAGE_NONE][0]['value'] = 1;
    opigno_og_access_node_set_og_permissions($entity);
  }
}