I'm the system administrator for a growing multisite drupal installation. One of the things we need to do in our development environment is allow the developers, who have administrator privileges, to run update.php. They need to do this pretty frequently when they upgrade modules. While we want to give them administrator privileges, we need to reserve the UID 1 administrator account for system administrators. The problem for us is that update.php has two modes which are set via settings.php; either the UID 1 account can run it, or anybody can. To use the latter mode, one must edit settings.php by hand, run update.php, and then edit it again. This is pretty awkward for the developers.

A reasonable, simple solution would seem to be to add an 'administer site updates' permission to the system module, and add a check for that in update.php. While the update.php script isn't part of any module, the system module seems to be the logical place for this. I've included a patch for the current development tree.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lilou’s picture

Status: Active » Needs review

we need also to change this message :

http://drupal.org/update.php?op=info

greggles’s picture

Status: Needs review » Needs work

One simplification: user_access returns true for UID 1 every time, so

if (!empty($update_free_access) || $user->uid == 1 || user_access('administer site updates')) {

could be

if (!empty($update_free_access) || user_access('administer site updates')) {
durist’s picture

FileSize
3.96 KB

Here's an updated patch that addresses comments #1 and #2.

greggles’s picture

Status: Needs work » Needs review
Dave Reid’s picture

Status: Needs review » Closed (duplicate)
greggles’s picture

Status: Closed (duplicate) » Needs review

Duplicate of itself?

Dave Reid’s picture

Status: Needs review » Closed (duplicate)

Hows that for meta linking? :)

I really meant #67234: Update script access rights.

networkgamer’s picture

I have the same problem with drupal 6. Is it possible to give another user the permissions for update.php than user 1 ?