function userpoints_access_my_points in User Points 7.2
Same name and namespace in other branches
- 6 userpoints.module \userpoints_access_my_points()
- 7 userpoints.module \userpoints_access_my_points()
Checks if user can access their points - used via hook_menu().
Parameters
$account: (optional) The account to check; if not given use currently logged in user.
Return value
TRUE if user has permissions to view userpoints and if the user is logged in.
1 call to userpoints_access_my_points()
- userpoints_access_view_transaction in ./
userpoints.module - Checks if a user has access to a transaction.
File
- ./
userpoints.module, line 368
Code
function userpoints_access_my_points($account = NULL) {
if (userpoints_admin_access('edit')) {
return TRUE;
}
return user_access('view userpoints') && user_is_logged_in() || user_access('view own userpoints');
}