Index: user_terms.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/user_terms/user_terms.module,v
retrieving revision 1.1.2.33
diff -u -p -r1.1.2.33 user_terms.module
--- user_terms.module	20 Oct 2010 16:17:25 -0000	1.1.2.33
+++ user_terms.module	19 Nov 2010 14:15:00 -0000
@@ -9,6 +9,13 @@
 
 define('USER_TERMS_GROUP_TITLE', t('User terms'));
 
+/**
+ * Implementation of hook_perm().
+ */
+function user_terms_perm() {
+  return array('set user terms', 'view own user terms', 'view user terms');
+}
+
 
 /**
  * Implementation of hook_help().
@@ -129,11 +136,15 @@ function user_terms_load_profile(&$accou
  *   The account from which data is loaded and displayed.
  */
 function user_terms_view_profile(&$account) {
+  global $user;
+
   $vids = variable_get('user_terms_vocabs', array());
 
-  // Skip everything if no user term vocabulary is selected or
-  // the user has no terms.
-  if (!empty($vids) && !empty($account->user_terms)) {
+  // Skip everything if no user term vocabulary is selected,
+  // the user has no terms or has no permissions.
+  if ((!empty($vids) && !empty($account->user_terms))
+       &&
+      (user_access('view user terms') || (user_access('view own user terms') && $user->uid == $account->uid ))) {
     
     // Create the main profile category.
     $account->content['user_terms'] = array(
@@ -253,8 +264,8 @@ function user_terms_form_profile($edit, 
       }
     }
 
-    // Skip everything if no user term vocabulary is selected.
-    if (!empty($vids)) {
+    // Skip everything if no user term vocabulary is selected or has no permissions.
+    if (!empty($vids) && user_access('set user terms')) {
       $form['user_terms'] = array(
         '#type' => 'fieldset',
         '#title' => t('User terms'),
