? image_pub-216086-5.patch
? image_pub_205535-4.patch
Index: image_pub.common.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image_pub/image_pub.common.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 image_pub.common.inc
--- image_pub.common.inc	28 Mar 2009 22:53:37 -0000	1.1.2.2
+++ image_pub.common.inc	28 Mar 2009 23:24:30 -0000
@@ -105,9 +105,9 @@ function _image_pub_album_access($type, 
   switch ($type) {
     case 'view':
       return user_access('access content');
-    case 'update':
-      return user_access('administer images');
     case 'create':
+      return user_access('administer images');
+    case 'update':
       return user_access('create images');
   }
   return FALSE;
Index: image_pub.xp.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/image_pub/image_pub.xp.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 image_pub.xp.inc
--- image_pub.xp.inc	31 Jan 2009 02:00:25 -0000	1.1.2.1
+++ image_pub.xp.inc	28 Mar 2009 23:24:30 -0000
@@ -131,7 +131,7 @@ function _image_pub_xp_album($edit) {
     $create_descr = $edit['create_descr'];
 
     $album = _image_pub_album_get($albumid);
-    if (!_image_pub_album_access('update', $album)) {
+    if (!_image_pub_album_access('create', $album)) {
       drupal_set_message('Created album permission denied.', 'error');
       _image_pub_xp_album_form('Create Album Permission Denied', $album);
     }
@@ -158,7 +158,7 @@ function _image_pub_xp_album($edit) {
     _image_pub_xp_album_form('Invalid album specified');
     return;
   }
-  if (!_image_pub_album_access('create', $album)) {
+  if (!_image_pub_album_access('update', $album)) {
     drupal_set_message('Create image permission denied.', 'error');
     _image_pub_xp_album_form('Create Image Permission Denied', $album);
     return;
@@ -307,15 +307,17 @@ function _image_pub_xp_album_form($messa
     '#type' => 'fieldset',
     '#tree' => FALSE,
   );
-
-  // radio button for existing album
-  $form['existing']['create_new'] = array(
-    '#type' => 'radio',
-    '#return_value' => 0,
-    '#title' => t('Use an existing album'),
-    '#attributes' => array('checked' => 'checked'),
-    '#parents' => array('edit', 'create_new'),
-  );
+  
+  if (user_access('administer images')) {
+    // radio button for existing album
+    $form['existing']['create_new'] = array(
+      '#type' => 'radio',
+      '#return_value' => 0,
+      '#title' => t('Use an existing album'),
+      '#attributes' => array('checked' => 'checked'),
+      '#parents' => array('edit', 'create_new'),
+      );
+  }
 
   // for some reason if a new album it doesn't always end up in the select list
   // I tried using cache_clear_all but that doesn't help
@@ -329,36 +331,38 @@ function _image_pub_xp_album_form($messa
   unset($form['existing']['albumid']['#weight']);
   unset($form['existing']['albumid']['#title']);
   unset($form['existing']['albumid']['#description']);
-
-  // create a container for new album fields
-  // call it edit to avoid having to force #parents
-  $form['edit'] = array(
-    '#type' => 'fieldset',
-    '#tree' => TRUE,
-  );
-
-  // radio button for new album
-  $form['edit']['create_new'] = array(
-    '#type' => 'radio',
-    '#return_value' => 1,
-    '#title' => t('Create a new album'),
-  );
-
-  // get the parent selector by calling _image_gallery_parent_select
-  $form['edit']['create_parentid'] = _image_gallery_parent_select(NULL, 'Within');
-
-  // reset #required option in this instance
-  unset($form['edit']['create_parentid']['#required']);
-
-  $form['edit']['create_name'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Album name'),
-  );
-
-  $form['edit']['create_descr'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Album description'),
-  );
+  
+  if (user_access('administer images')) {
+    // create a container for new album fields
+    // call it edit to avoid having to force #parents
+    $form['edit'] = array(
+      '#type' => 'fieldset',
+      '#tree' => TRUE,
+      );
+    
+    // radio button for new album
+    $form['edit']['create_new'] = array(
+      '#type' => 'radio',
+      '#return_value' => 1,
+      '#title' => t('Create a new album'),
+      );
+    
+    // get the parent selector by calling _image_gallery_parent_select
+    $form['edit']['create_parentid'] = _image_gallery_parent_select(NULL, 'Within');
+    
+    // reset #required option in this instance
+    unset($form['edit']['create_parentid']['#required']);
+    
+    $form['edit']['create_name'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Album name'),
+      );
+    
+    $form['edit']['create_descr'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Album description'),
+      );
+  }
 
   // Common section - render to all forms
   $form['cmd'] = array(
