You are here

public function OgGroup::access in Organic groups 7

Return TRUE if user has access to 'view', 'update' or 'delete' the entity that is the group. Otherwise return FALSE.

This function currently only checks access if the entity type is a node.

Parameters

$op: The operation to be performed on the node. Possible values are:

  • "view"
  • "update"
  • "delete"

$account: Optional, a user object representing the user for whom the operation is to be performed. Determines access for a user other than the current user.

Return value

TRUE if the operation may be performed, FALSE otherwise.

File

./og.module, line 1315
Enable users to create and manage groups with roles and permissions.

Class

OgGroup
Main class for Group entities provided by Entity API.

Code

public function access($op = 'view', $account = NULL) {
  $access = entity_access($op, $this->entity_type, $this
    ->getEntity(), $account);
  if (!isset($access)) {

    // If no access information is available, default to grant access.
    return TRUE;
  }
  return $access;
}