You are here

function userpoints_access_my_points in User Points 7

Same name and namespace in other branches
  1. 6 userpoints.module \userpoints_access_my_points()
  2. 7.2 userpoints.module \userpoints_access_my_points()

Checks if user can access their points - used via hook_menu().

Return value

TRUE if user has permissions to view userpoints and if the user is logged in.

2 calls to userpoints_access_my_points()
userpoints_access_view_transaction in ./userpoints.module
Checks if a user has access to a transaction.
userpoints_get_points_list in ./userpoints.module
Returns a render array that displays the points and action links.
1 string reference to 'userpoints_access_my_points'
userpoints_menu in ./userpoints.module
Implements hook_menu().

File

./userpoints.module, line 371

Code

function userpoints_access_my_points($account = NULL) {
  global $user;
  if ($account && $user->uid != $account->uid) {
    return userpoints_admin_access('edit');
  }
  return user_access('view userpoints') && user_is_logged_in() || user_access('view own userpoints');
}