You are here

function lti_tool_provider_consumer_access in LTI Tool Provider 7

Determines whether the given user has access to view a tool provider consumer.

Parameters

$op: The operation being performed. One of 'view', 'update', 'create', 'delete'.

$item: Optionally a field collection item. If nothing is given, access for all items is determined.

$account: The user to check for. Leave it to NULL to check for the global user.

Return value

boolean Whether access is allowed or not.

2 string references to 'lti_tool_provider_consumer_access'
lti_tool_provider_entity_info in ./lti_tool_provider.module
Implements hook_entity_info().
lti_tool_provider_menu in ./lti_tool_provider.module
Implements hook_menu().

File

./lti_tool_provider.module, line 743
lti_tool_provider hook implementations and support functions.

Code

function lti_tool_provider_consumer_access($op, $item = NULL, $account = NULL) {

  // allow administer permission to trump all others
  if (user_access('administer lti_tool_provider module', $account)) {
    return TRUE;
  }

  // allow for access of the entity type
  if ($op == 'view' && user_access('access lti_tool_provider_consumer entities', $account)) {
    return TRUE;
  }

  // they didn't have viewer rights ignore this call
  return FALSE;
}