--- userpoints.module	2011-02-02 21:09:31.000000000 +0300
+++ ../userpoints.module	2011-02-04 12:32:47.275140002 +0300
@@ -8,6 +8,7 @@ define('USERPOINTS_PERM_VIEW_OWN',
 //The permission(PERM_USE) was removed from use as per #158490 it'll remain
 //out until code exists to use the permission (jredding 12/26/2007)
 define('USERPOINTS_PERM_USE',            'use userpoints');
+define('USERPOINTS_PERM_VIEW_TRANS',     'view all userpoints transactions');
 define('USERPOINTS_PERM_ADMIN',          'administer userpoints');
 
 define('USERPOINTS_TRANS_UCPOINTS',      'userpoints_trans_ucpoints');
@@ -163,6 +164,7 @@ function userpoints_menu() {
     'title arguments' => userpoints_translation(),
     'page callback'   => 'userpoints_list_my_userpoints',
     'access callback' => 'userpoints_access_my_points',
+    'access arguments'=> array(1),
     'type'            => MENU_NORMAL_ITEM
   );
   return $items;
@@ -174,20 +176,36 @@ function userpoints_menu() {
  * @return TRUE if user has permissions to view userpoints and if the user is logged in
  */
 function userpoints_access_my_points() {
-  global $user;
-  if ($user->uid === 1 || user_access(USERPOINTS_PERM_ADMIN)) {
+	global $user;  
+
+ if ($user->uid === 1 || user_access(USERPOINTS_PERM_ADMIN)) {
     return TRUE;
+  } // root, admin perms
+
+   if (user_access(USERPOINTS_PERM_VIEW_TRANS)) {
+    return TRUE;
+  } // view all transaction perms
+
+  // User which are displaying points for
+  $uid = (int)arg(1);
+  if ($uid) {
+    if ($uid != $user->uid) {
+      // If not the same as logged in user
+      return FALSE;
+    }
   }
-  return ( _userpoints_user_exists($user->uid) &&
-          ((user_access(USERPOINTS_PERM_VIEW) && user_is_logged_in()) || user_access(USERPOINTS_PERM_VIEW_OWN))
-         );
+
+  return (user_access(USERPOINTS_PERM_VIEW) || user_access(USERPOINTS_PERM_VIEW_OWN));
+  // viewing transactions of myself
+
+
 }
 
 /**
  * Implementation of hook_perm().
  */
 function userpoints_perm() {
-  return array(USERPOINTS_PERM_VIEW, USERPOINTS_PERM_VIEW_OWN, USERPOINTS_PERM_ADMIN);
+  return array(USERPOINTS_PERM_VIEW, USERPOINTS_PERM_VIEW_OWN, USERPOINTS_PERM_ADMIN, USERPOINTS_PERM_VIEW_TRANS);
 }
 
 /**
@@ -1656,11 +1674,6 @@ function userpoints_list_my_userpoints()
   // User which are displaying points for
   $uid = (int)arg(1);
   if ($uid) {
-    if ($uid != $user->uid && !user_access(USERPOINTS_PERM_ADMIN)) {
-      // If not the same as logged in user
-      drupal_access_denied();
-      return;
-    }
   }
   else {
     // Default to currently logged in user
@@ -1668,13 +1681,6 @@ function userpoints_list_my_userpoints()
   }
   $point_user = user_load(array('uid' => $uid));
 
-  // Check permissions
-  if (!user_access(USERPOINTS_PERM_VIEW) && !user_access(USERPOINTS_PERM_VIEW_OWN)) {
-    // User has no access to view points
-    drupal_access_denied();
-    return;
-  }
-
   $title = t('!Points for ', userpoints_translation()) . check_plain($point_user->name);
   drupal_set_title($title);
 
