diff --git sites/all/modules/userpoints/userpoints/userpoints.module sites/all/modules/userpoints/userpoints/userpoints.module index d64f9d7..3cba1bf 100755 --- sites/all/modules/userpoints/userpoints/userpoints.module +++ sites/all/modules/userpoints/userpoints/userpoints.module @@ -9,6 +9,7 @@ define('USERPOINTS_PERM_VIEW_OWN', 'view own userpoints'); //out until code exists to use the permission (jredding 12/26/2007) define('USERPOINTS_PERM_USE', 'use userpoints'); define('USERPOINTS_PERM_ADMIN', 'administer userpoints'); +define('USERPOINTS_PERM_ADJUST', 'adjust userpoints'); define('USERPOINTS_TRANS_UCPOINTS', 'userpoints_trans_ucpoints'); define('USERPOINTS_TRANS_LCPOINTS', 'userpoints_trans_lcpoints'); @@ -96,7 +97,7 @@ function userpoints_menu() { 'title arguments' => userpoints_translation(), 'description' => strtr('Manage !points', userpoints_translation()), 'page callback' => 'userpoints_admin_points', - 'access arguments' => array(USERPOINTS_PERM_ADMIN) + 'access arguments' => array(USERPOINTS_PERM_ADJUST) ); $items['admin/user/userpoints/list'] = array( 'title' => 'List', @@ -111,7 +112,7 @@ function userpoints_menu() { 'title arguments' => userpoints_translation(), 'description' => strtr('Review !points in moderation', userpoints_translation()), 'page callback' => 'userpoints_admin_manage', - 'access arguments' => array(USERPOINTS_PERM_ADMIN), + 'access arguments' => array(USERPOINTS_PERM_ADJUST), 'type' => MENU_LOCAL_TASK, 'weight' => -1, ); @@ -120,7 +121,7 @@ function userpoints_menu() { 'description' => 'Admin add/delete userpoints', 'page callback' => 'drupal_get_form', 'page arguments' => array('userpoints_admin_txn'), - 'access arguments' => array(USERPOINTS_PERM_ADMIN), + 'access arguments' => array(USERPOINTS_PERM_ADJUST), 'type' => MENU_LOCAL_TASK, 'weight' => 0, ); @@ -128,20 +129,20 @@ function userpoints_menu() { 'title' => 'Edit', 'page callback' => 'drupal_get_form', 'page arguments' => array('userpoints_admin_txn'), - 'access arguments' => array(USERPOINTS_PERM_ADMIN), + 'access arguments' => array(USERPOINTS_PERM_ADJUST), 'type' => MENU_CALLBACK ); $items['admin/user/userpoints/approve'] = array( 'title' => 'Approve Userpoints', 'page callback' => 'userpoints_admin_approve', - 'access arguments' => array(USERPOINTS_PERM_ADMIN), + 'access arguments' => array(USERPOINTS_PERM_ADJUST), 'type' => MENU_CALLBACK ); $items['admin/user/userpoints/decline'] = array( 'title' => 'Approve Userpoints', 'page callback' => 'userpoints_admin_approve', - 'access arguments' => array(USERPOINTS_PERM_ADMIN), + 'access arguments' => array(USERPOINTS_PERM_ADJUST), 'type' => MENU_CALLBACK ); @@ -179,7 +180,7 @@ function userpoints_access_my_points() { * 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_ADJUST); } /** @@ -817,7 +818,7 @@ function userpoints_user($op, &$edit, &$account, $category = '') { if (userpoints_access_my_points()) { $details .= l(t('View'), 'myuserpoints/'. $account->uid, array('attributes' => array('title' => t('View detailed transactions')))); } - if (user_access(USERPOINTS_PERM_ADMIN)) { + if (user_access(USERPOINTS_PERM_ADMIN) || user_access(USERPOINTS_PERM_ADJUST)) { if (!is_null($details)) { $details .= ', '; }