--- img_assist.module	2005-05-20 12:04:35.886601336 -0700
+++ img_assist.module.syg	2005-05-20 12:04:18.531772666 -0700
@@ -34,10 +34,10 @@
 function img_assist_menu($may_cache) {
   $items = array();
   if ($may_cache) {
-    $items[] = array('path' => 'img_assist/add', 'title' => t('img assist add'), 'callback' => 'img_assist_create', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
-    $items[] = array('path' => 'img_assist/gen', 'title' => t('img assist generate image'), 'callback' => 'img_assist_generate_image', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
-    $items[] = array('path' => 'img_assist/load', 'title' => t('img assist loader'), 'callback' => 'img_assist_file_load', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
-    $items[] = array('path' => 'img_assist/add/image', 'title' => t('img assist image add'), 'callback' => 'img_assist_image_add', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'img_assist/add', 'title' => t('img assist add'), 'callback' => 'img_assist_create', 'access' => user_access('access img_assist'), 'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'img_assist/gen', 'title' => t('img assist generate image'), 'callback' => 'img_assist_generate_image', 'access' => user_access('access img_assist'), 'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'img_assist/load', 'title' => t('img assist loader'), 'callback' => 'img_assist_file_load', 'access' => user_access('access img_assist'), 'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'img_assist/add/image', 'title' => t('img assist image add'), 'callback' => 'img_assist_image_add', 'access' => user_access('access img_assist'), 'type' => MENU_CALLBACK);
   }
   return $items;
 }
@@ -46,7 +46,7 @@
  * Implementation of hook_perm().
  */
 function img_assist_perm() {
-  return array('choose format type');
+  return array('choose format type', 'access img_assist');
 }
 
 /**
@@ -172,10 +172,13 @@
  * Add image links underneath textareas.
  */
 function img_assist_textarea($op, $name) {
-  if ($op == 'post' && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist/add/image')) {
-    $anchor = '<div class="img_assist-button"><a class="img_assist-link" id="img_assist-link-edit-'. $name .'" title="Click here to add images" href="'. url('img_assist/add', 'textarea=edit['. $name. ']') .'" onclick="window.open(this.href, \'img_assist_link\', \'width=500,height=625,scrollbars=yes,status=yes,resizable=yes\'); return false">';
-    $image = '<img src="'. drupal_get_path('module', 'img_assist') .'/add-image.jpg" width="36" height="25" />';
-    return $anchor. $image . '</a></div>';
+  global $user;
+  if (user_access('access img_assist')) {
+    if ($op == 'post' && _img_assist_page_match() && !strstr($_GET['q'], 'img_assist/add/image')) {
+      $anchor = '<div class="img_assist-button"><a class="img_assist-link" id="img_assist-link-edit-'. $name .'" title="Click here to add images" href="'. url('img_assist/add', 'textarea=edit['. $name. ']') .'" onclick="window.open(this.href, \'img_assist_link\', \'width=500,height=625,scrollbars=yes,status=yes,resizable=yes\'); return false">';
+      $image = '<img src="'. drupal_get_path('module', 'img_assist') .'/add-image.jpg" width="36" height="25" />';
+      return $anchor. $image . '</a></div>';
+    }
   }
 }
 
