Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

avatar_selection_access

Definition

avatar_selection_access($op, $node, $account)
contributions/avatar_selection/avatar_selection.module, line 54

Description

Implementation of hook_access().

Define what does each permission means : 'view' is included in the 'access avatars' permission; while 'create', 'update' and 'delete' are included in the 'administrer avatar selection'.

Parameters

$op The action the user wants to do after the function checks the permission.

$node The node where the specific permission is requested.

Return value

The access needed to perform a certain operation.

Code

<?php
function avatar_selection_access($op, $node, $account) {
  if ($op == 'view') {
    return user_access('access avatars');
  }
  else if ($op == 'create' || $op == 'update' || $op == 'delete') {
    return user_access('administer avatar selection');
  }
}
?>