diff -ru imce/imce.module imce/imce.module
--- imce/imce.module	2010-05-29 08:27:24.000000000 +0000
+++ imce/imce.module	2010-07-14 01:24:30.000000000 +0000
@@ -6,12 +6,20 @@
  * Implements the necessary hooks for the file browser to work properly.
  */
 
+
+function _imce_admin_permission_name() {
+  return 'administer imce(execute PHP)';
+}
+
+function _imce_has_admin_permission($account = NULL, $reset = FALSE) {
+  return user_access(_imce_admin_permission_name(),$account,$reset);
+}
+
 /**
  * Implementation of hook_menu().
  */
 function imce_menu() {
   $items = array();
-  $access = array('administer imce(execute PHP)');
   $items['imce'] = array(
     'title' => 'File browser',
     'page callback' => 'imce',
@@ -33,13 +41,13 @@
     'title' => 'IMCE',
     'description' => 'Control how your image/file browser works.',
     'page callback' => 'imce_admin',
-    'access arguments' => $access,
+    'access arguments' => imce_perm(),
     'file' => 'inc/imce.admin.inc',
   );
   $items['admin/settings/imce/profile'] = array(
     'title' => 'Add new profile',
     'page callback' => 'imce_profile_operations',
-    'access arguments' => $access,
+    'access arguments' => imce_perm(),
     'type' => MENU_CALLBACK,
     'file' => 'inc/imce.admin.inc',
   );
@@ -50,7 +58,7 @@
  * Implementation of hook_perm().
  */
 function imce_perm() {
-  return array('administer imce(execute PHP)');
+  return array(_imce_admin_permission_name());
 }
 
 /**
@@ -167,6 +175,10 @@
       }
     }
   }
+  // if the user has no profiles but has admin access, return profile #1
+  if(_imce_has_admin_permission($user) && isset($profiles[1])) {
+    return $profiles[1];
+  }
   return FALSE;
 }
 
@@ -178,7 +190,7 @@
     global $user;
   }
 
-  if ($user->uid == 1) {
+  if (_imce_has_admin_permission($user)) {
     return TRUE;
   }
 
@@ -195,9 +207,13 @@
 /**
  * Checks access to user/{$account->uid}/imce for the $user.
  */
-function imce_user_page_access($account, $user = FALSE) {
-  if ($user === FALSE) {
-    global $user;
+function imce_user_page_access($account, $user = NULL) {
+  if (!isset($user)) {
+    $user = $GLOBALS['user'];
+  }
+
+  if (_imce_has_admin_permission($user)) {
+    return TRUE;
   }
 
   return $account->uid == $user->uid && ($profile = imce_user_profile($user)) && $profile['usertab'];
@@ -208,4 +224,4 @@
  */
 function imce_reg_dir($dirname) {
   return $dirname == '.' || (is_string($dirname) && $dirname != '' && !preg_match('@(^\s)|(^/)|(^\./)|(\s$)|(/$)|(/\.$)|(\.\.)|(//)|(\\\\)|(/\./)@', $dirname));
-}
\ No newline at end of file
+}
diff -ru imce/inc/imce.admin.inc imce/inc/imce.admin.inc
--- imce/inc/imce.admin.inc	2010-05-29 01:56:36.000000000 +0000
+++ imce/inc/imce.admin.inc	2010-07-14 00:51:24.000000000 +0000
@@ -155,7 +155,7 @@
     return drupal_get_form('imce_profile_delete_form', $pid);
   }
   //add-edit
-  if ($pid != 1 || $GLOBALS['user']->uid == 1) {
+  if ($pid != 1 || _imce_has_admin_permission()) {
     return drupal_get_form('imce_profile_form', $pid);
   }
   drupal_access_denied();
@@ -640,4 +640,4 @@
 }
 
 //Include core profile functions.
-module_load_include('inc', 'imce', 'inc/imce.core.profiles');
\ No newline at end of file
+module_load_include('inc', 'imce', 'inc/imce.core.profiles');
