? 226479-update-rebuild-permissions-check-rev2.patch
? 226479-update-rebuild-permissions-check.patch
? 480660-add-administrator-role.patch
? d7
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.54
diff -u -p -r1.54 user.admin.inc
--- modules/user/user.admin.inc	2 Jun 2009 06:58:17 -0000	1.54
+++ modules/user/user.admin.inc	3 Jun 2009 16:25:32 -0000
@@ -574,6 +574,14 @@ function user_admin_perm($form_state, $r
   if (is_numeric($rid)) {
     $role_names = array($rid => $role_names[$rid]);
   }
+
+  // Since 'administrator' role has equivelent permissions to user #1, remove them from the permissions page.
+  foreach ($role_names as $rid => $name) {
+    if ($name == 'administrator') {
+      unset($role_names[$rid]);
+    }
+  }
+
   // Fetch permissions for all roles or the one selected role.
   $role_permissions = user_role_permissions($role_names);
 
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.998
diff -u -p -r1.998 user.module
--- modules/user/user.module	3 Jun 2009 07:28:28 -0000	1.998
+++ modules/user/user.module	3 Jun 2009 16:25:38 -0000
@@ -752,8 +752,8 @@ function user_access($string, $account =
     $account = $user;
   }
 
-  // User #1 has all privileges:
-  if ($account->uid == 1) {
+  // Both user #1 & the administrator role have all privileges:
+  if (($account->uid == 1) || in_array("administrator", $user->roles)){
     return TRUE;
   }
 
@@ -2401,7 +2401,9 @@ function user_help($path, $arg) {
     case 'admin/user/user/account/create':
       return '<p>' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '</p>';
     case 'admin/user/permissions':
-      return '<p>' . t('Permissions let you control what users can do on your site. Each user role (defined on the <a href="@role">user roles page</a>) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) . '</p>';
+      $output = '<p>' . t('Permissions let you control what users can do on your site. Each user role (defined on the <a href="@role">user roles page</a>) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) . '</p>';
+      $output .= '<p>' . t('The administrator role is not displayed, as it automatically has all permissions.') . '</p>';
+      return $output;
     case 'admin/user/roles':
       return t('<p>Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in <a href="@permissions">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <em>role names</em> of the various roles. To delete a role choose "edit".</p><p>By default, Drupal comes with two user roles:</p>
       <ul>
Index: profiles/default/default.profile
===================================================================
RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v
retrieving revision 1.44
diff -u -p -r1.44 default.profile
--- profiles/default/default.profile	29 May 2009 21:39:17 -0000	1.44
+++ profiles/default/default.profile	3 Jun 2009 16:25:39 -0000
@@ -214,6 +214,10 @@ function default_profile_tasks(&$task, $
   ))->execute();
   db_insert('taxonomy_vocabulary_node_type')->fields(array('vid' => $vid, 'type' => 'article'))->execute();
 
+  // Create a default role for site administrators.
+  db_insert('role')->fields(array('name' => 'administrator'))->execute();
+
+
   // Update the menu router information.
   menu_rebuild();
 
