You are here

function library_may_view_history in Library 7

Checks, whether a user is allowed to view a particular lending history.

Parameters

int $patron_user: User id.

Return value

bool User has access to lending history in this context.

1 string reference to 'library_may_view_history'
library_menu in ./library.module
Implements hook_menu().

File

./library.module, line 130

Code

function library_may_view_history($patron_user) {
  global $user;
  if (user_access('view library history')) {
    return TRUE;
  }
  elseif (user_access('view own library history', $user)) {
    if ($patron_user->uid == $user->uid) {
      return TRUE;
    }
  }
  return FALSE;
}