- Patch #446666 by cweagans: split 'administer site configuration' into more granular permissions.
parent
48377c459b
commit
bdf018696f
|
|
@ -235,7 +235,7 @@ class NonDefaultBlockAdmin extends DrupalWebTestCase {
|
||||||
* Test non-default theme admin.
|
* Test non-default theme admin.
|
||||||
*/
|
*/
|
||||||
function testNonDefaultBlockAdmin() {
|
function testNonDefaultBlockAdmin() {
|
||||||
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer site configuration'));
|
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes'));
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
theme_enable(array('stark'));
|
theme_enable(array('stark'));
|
||||||
$this->drupalGet('admin/structure/block/list/stark');
|
$this->drupalGet('admin/structure/block/list/stark');
|
||||||
|
|
@ -259,7 +259,7 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase {
|
||||||
*/
|
*/
|
||||||
function testNewDefaultThemeBlocks() {
|
function testNewDefaultThemeBlocks() {
|
||||||
// Create administrative user.
|
// Create administrative user.
|
||||||
$admin_user = $this->drupalCreateUser(array('administer site configuration'));
|
$admin_user = $this->drupalCreateUser(array('administer themes'));
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Ensure no other theme's blocks are in the block table yet.
|
// Ensure no other theme's blocks are in the block table yet.
|
||||||
|
|
@ -304,7 +304,7 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase {
|
||||||
*/
|
*/
|
||||||
function testAdminTheme() {
|
function testAdminTheme() {
|
||||||
// Create administrative user.
|
// Create administrative user.
|
||||||
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer site configuration'));
|
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes'));
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
|
|
||||||
// Ensure that access to block admin page is denied when theme is disabled.
|
// Ensure that access to block admin page is denied when theme is disabled.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class ColorTestCase extends DrupalWebTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp('color');
|
parent::setUp('color');
|
||||||
// Create users.
|
// Create users.
|
||||||
$this->big_user = $this->drupalCreateUser(array('administer site configuration'));
|
$this->big_user = $this->drupalCreateUser(array('administer themes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -204,9 +204,15 @@ function system_theme() {
|
||||||
*/
|
*/
|
||||||
function system_permission() {
|
function system_permission() {
|
||||||
return array(
|
return array(
|
||||||
|
'administer modules' => array(
|
||||||
|
'title' => t('Administer modules'),
|
||||||
|
),
|
||||||
'administer site configuration' => array(
|
'administer site configuration' => array(
|
||||||
'title' => t('Administer site configuration'),
|
'title' => t('Administer site configuration'),
|
||||||
),
|
),
|
||||||
|
'administer themes' => array(
|
||||||
|
'title' => t('Administer themes'),
|
||||||
|
),
|
||||||
'administer software updates' => array(
|
'administer software updates' => array(
|
||||||
'title' => t('Run software updates'),
|
'title' => t('Run software updates'),
|
||||||
),
|
),
|
||||||
|
|
@ -582,7 +588,7 @@ function system_menu() {
|
||||||
'title' => 'Appearance',
|
'title' => 'Appearance',
|
||||||
'description' => 'Select and configure your site theme.',
|
'description' => 'Select and configure your site theme.',
|
||||||
'page callback' => 'system_themes_page',
|
'page callback' => 'system_themes_page',
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer themes'),
|
||||||
'position' => 'left',
|
'position' => 'left',
|
||||||
'weight' => -6,
|
'weight' => -6,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
|
|
@ -597,21 +603,21 @@ function system_menu() {
|
||||||
$items['admin/appearance/enable'] = array(
|
$items['admin/appearance/enable'] = array(
|
||||||
'title' => 'Enable theme',
|
'title' => 'Enable theme',
|
||||||
'page callback' => 'system_theme_enable',
|
'page callback' => 'system_theme_enable',
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer themes'),
|
||||||
'type' => MENU_CALLBACK,
|
'type' => MENU_CALLBACK,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
);
|
);
|
||||||
$items['admin/appearance/disable'] = array(
|
$items['admin/appearance/disable'] = array(
|
||||||
'title' => 'Disable theme',
|
'title' => 'Disable theme',
|
||||||
'page callback' => 'system_theme_disable',
|
'page callback' => 'system_theme_disable',
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer themes'),
|
||||||
'type' => MENU_CALLBACK,
|
'type' => MENU_CALLBACK,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
);
|
);
|
||||||
$items['admin/appearance/default'] = array(
|
$items['admin/appearance/default'] = array(
|
||||||
'title' => 'Set default theme',
|
'title' => 'Set default theme',
|
||||||
'page callback' => 'system_theme_default',
|
'page callback' => 'system_theme_default',
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer themes'),
|
||||||
'type' => MENU_CALLBACK,
|
'type' => MENU_CALLBACK,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
);
|
);
|
||||||
|
|
@ -620,7 +626,7 @@ function system_menu() {
|
||||||
'description' => 'Configure default and theme specific settings.',
|
'description' => 'Configure default and theme specific settings.',
|
||||||
'page callback' => 'drupal_get_form',
|
'page callback' => 'drupal_get_form',
|
||||||
'page arguments' => array('system_theme_settings'),
|
'page arguments' => array('system_theme_settings'),
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer themes'),
|
||||||
'type' => MENU_LOCAL_TASK,
|
'type' => MENU_LOCAL_TASK,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
);
|
);
|
||||||
|
|
@ -661,7 +667,7 @@ function system_menu() {
|
||||||
'description' => 'Enable or disable add-on modules for your site.',
|
'description' => 'Enable or disable add-on modules for your site.',
|
||||||
'page callback' => 'drupal_get_form',
|
'page callback' => 'drupal_get_form',
|
||||||
'page arguments' => array('system_modules'),
|
'page arguments' => array('system_modules'),
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer modules'),
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
'type' => MENU_LOCAL_TASK,
|
'type' => MENU_LOCAL_TASK,
|
||||||
'weight' => 10,
|
'weight' => 10,
|
||||||
|
|
@ -672,19 +678,19 @@ function system_menu() {
|
||||||
);
|
);
|
||||||
$items['admin/config/modules/list/confirm'] = array(
|
$items['admin/config/modules/list/confirm'] = array(
|
||||||
'title' => 'List',
|
'title' => 'List',
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer modules'),
|
||||||
'type' => MENU_CALLBACK,
|
'type' => MENU_CALLBACK,
|
||||||
);
|
);
|
||||||
$items['admin/config/modules/uninstall'] = array(
|
$items['admin/config/modules/uninstall'] = array(
|
||||||
'title' => 'Uninstall',
|
'title' => 'Uninstall',
|
||||||
'page arguments' => array('system_modules_uninstall'),
|
'page arguments' => array('system_modules_uninstall'),
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer modules'),
|
||||||
'type' => MENU_LOCAL_TASK,
|
'type' => MENU_LOCAL_TASK,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
);
|
);
|
||||||
$items['admin/config/modules/uninstall/confirm'] = array(
|
$items['admin/config/modules/uninstall/confirm'] = array(
|
||||||
'title' => 'Uninstall',
|
'title' => 'Uninstall',
|
||||||
'access arguments' => array('administer site configuration'),
|
'access arguments' => array('administer modules'),
|
||||||
'type' => MENU_CALLBACK,
|
'type' => MENU_CALLBACK,
|
||||||
'file' => 'system.admin.inc',
|
'file' => 'system.admin.inc',
|
||||||
);
|
);
|
||||||
|
|
@ -1471,7 +1477,7 @@ function blocked_ip_load($iid) {
|
||||||
* Menu item access callback - only admin or enabled themes can be accessed.
|
* Menu item access callback - only admin or enabled themes can be accessed.
|
||||||
*/
|
*/
|
||||||
function _system_themes_access($theme) {
|
function _system_themes_access($theme) {
|
||||||
return user_access('administer site configuration') && drupal_theme_access($theme);
|
return user_access('administer themes') && drupal_theme_access($theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class ModuleTestCase extends DrupalWebTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp('system_test');
|
parent::setUp('system_test');
|
||||||
|
|
||||||
$this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration'));
|
$this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer modules'));
|
||||||
$this->drupalLogin($this->admin_user);
|
$this->drupalLogin($this->admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1023,6 +1023,7 @@ class SystemMainContentFallback extends DrupalWebTestCase {
|
||||||
$this->admin_user = $this->drupalCreateUser(array(
|
$this->admin_user = $this->drupalCreateUser(array(
|
||||||
'access administration pages',
|
'access administration pages',
|
||||||
'administer site configuration',
|
'administer site configuration',
|
||||||
|
'administer modules',
|
||||||
'administer blocks',
|
'administer blocks',
|
||||||
'administer nodes',
|
'administer nodes',
|
||||||
));
|
));
|
||||||
|
|
@ -1050,7 +1051,7 @@ class SystemMainContentFallback extends DrupalWebTestCase {
|
||||||
|
|
||||||
// At this point, no region is filled and fallback should be triggered.
|
// At this point, no region is filled and fallback should be triggered.
|
||||||
$this->drupalGet('admin/config/system/site-information');
|
$this->drupalGet('admin/config/system/site-information');
|
||||||
$this->assertField('site_name', t('Admin interface still availble.'));
|
$this->assertField('site_name', t('Admin interface still available.'));
|
||||||
|
|
||||||
// Fallback should not trigger when another module is handling content.
|
// Fallback should not trigger when another module is handling content.
|
||||||
$this->drupalGet('system-test/main-content-handling');
|
$this->drupalGet('system-test/main-content-handling');
|
||||||
|
|
@ -1071,7 +1072,7 @@ class SystemMainContentFallback extends DrupalWebTestCase {
|
||||||
// Request a user* page and see if it is displayed.
|
// Request a user* page and see if it is displayed.
|
||||||
$this->drupalLogin($this->web_user);
|
$this->drupalLogin($this->web_user);
|
||||||
$this->drupalGet('user/' . $this->web_user->uid . '/edit');
|
$this->drupalGet('user/' . $this->web_user->uid . '/edit');
|
||||||
$this->assertField('mail', t('User interface still availble.'));
|
$this->assertField('mail', t('User interface still available.'));
|
||||||
|
|
||||||
// Enable the block module again.
|
// Enable the block module again.
|
||||||
$this->drupalLogin($this->admin_user);
|
$this->drupalLogin($this->admin_user);
|
||||||
|
|
@ -1176,7 +1177,7 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer site configuration', 'bypass node access'));
|
$this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer themes', 'bypass node access'));
|
||||||
$this->drupalLogin($this->admin_user);
|
$this->drupalLogin($this->admin_user);
|
||||||
$this->node = $this->drupalCreateNode();
|
$this->node = $this->drupalCreateNode();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class UpdateCoreTestCase extends UpdateTestHelper {
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp('update_test', 'update');
|
parent::setUp('update_test', 'update');
|
||||||
$admin_user = $this->drupalCreateUser(array('administer site configuration'));
|
$admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer modules'));
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -872,7 +872,7 @@ class UserPermissionsTestCase extends DrupalWebTestCase {
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->admin_user = $this->drupalCreateUser(array('administer permissions', 'access user profiles', 'administer site configuration', 'administer users'));
|
$this->admin_user = $this->drupalCreateUser(array('administer permissions', 'access user profiles', 'administer site configuration', 'administer modules', 'administer users'));
|
||||||
|
|
||||||
// Find the new role ID - it must be the maximum.
|
// Find the new role ID - it must be the maximum.
|
||||||
$all_rids = array_keys($this->admin_user->roles);
|
$all_rids = array_keys($this->admin_user->roles);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue