function library_may_perform_action in Library 7
Determine whether a user may perform any library action.
Parameters
int $aid: The id of the aid in question.
Return value
bool User is allowed to perform action.
1 string reference to 'library_may_perform_action'
- library_menu in ./
library.module - Implements hook_menu().
File
- ./
library.module, line 107
Code
function library_may_perform_action($aid) {
global $user;
if (user_access('administer transactions', $user)) {
return TRUE;
}
elseif ($aid) {
$action = library_get_action($aid);
if ($action->name) {
return user_access('submit library ' . $action->name, $user);
}
}
return FALSE;
}