function avatar_selection_access in Avatar Selection 6
Same name and namespace in other branches
- 5.2 avatar_selection.module \avatar_selection_access()
- 5 avatar_selection.module \avatar_selection_access()
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.
File
- ./
avatar_selection.module, line 54 - The Avatar Selection module allows the user to pick an avatar image from a list already loaded by an administrative user, and to the administrator to disable uploading other avatar files by the user.
Code
function avatar_selection_access($op, $node, $account) {
if ($op == 'view') {
return user_access('access avatars');
}
elseif ($op == 'create' || $op == 'update' || $op == 'delete') {
return user_access('administer avatar selection');
}
}