From: Brion Vibber Date: Sun, 19 Jun 2005 07:03:55 +0000 (+0000) Subject: * Changed $wgGroupPermissions to more cut-n-paste-friendly format X-Git-Tag: 1.5.0beta1~147 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=684c0ba6ae4841ce21d8a705a081cfa0030eaecc;p=lhc%2Fweb%2Fwiklou.git * Changed $wgGroupPermissions to more cut-n-paste-friendly format * 'developer' group deprecated by default --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1a7530bf51..454260e8c4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -298,6 +298,8 @@ Various bugfixes, small features, and a few experimental things: * (bug 2277) Added Friulian language file * Less gratuitous munging of content sample in delete summary * badaccess/badaccesstext to supercede sysop*, developer* messages +* Changed $wgGroupPermissions to more cut-n-paste-friendly format +* 'developer' group deprecated by default === Caveats === diff --git a/UPGRADE b/UPGRADE index 07767beb62..2c56689232 100644 --- a/UPGRADE +++ b/UPGRADE @@ -46,7 +46,7 @@ $wgWhitelistAccount has been replaced by the 'createaccount' permission key in $wgGroupPermissions. To emulate the old effect of setting: $wgWhitelistAccount['user'] = 0; set: - $wgGroupPermissions['*'] = array( 'read' ); // without createaccount + $wgGroupPermissions['*']['createaccount'] = false; If $wgWhitelistRead is set, things need to be funked around. This needs work. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6b9751ddd6..2bba373cdc 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -679,16 +679,35 @@ $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire * combined with the permissions of all groups that a given user is listed * in in the user_groups table. */ -$wgGroupPermissions = array( - '*' => array( 'read', 'createaccount' ), - 'user' => array( 'read', 'move' ), - - 'bot' => array( 'bot' ), - 'sysop' => array( 'createaccount', 'patrol', 'protect', 'delete', - 'rollback', 'block', 'editinterface' ), - 'bureaucrat' => array( 'userrights' ), - 'developer' => array( 'siteadmin' ), -); +$wgGroupPermissions = array(); + +$wgGroupPermissions['*' ]['createaccount'] = true; +$wgGroupPermissions['*' ]['read'] = true; + +$wgGroupPermissions['user' ]['move'] = true; +$wgGroupPermissions['user' ]['read'] = true; + +$wgGroupPermissions['bot' ]['bot'] = true; + +$wgGroupPermissions['sysop']['block'] = true; +$wgGroupPermissions['sysop']['createaccount'] = true; +$wgGroupPermissions['sysop']['delete'] = true; +$wgGroupPermissions['sysop']['editinterface'] = true; +$wgGroupPermissions['sysop']['import'] = true; +$wgGroupPermissions['sysop']['importraw'] = true; +$wgGroupPermissions['sysop']['patrol'] = true; +$wgGroupPermissions['sysop']['protect'] = true; +$wgGroupPermissions['sysop']['rollback'] = true; + +$wgGroupPermissions['bureaucrat']['userrights'] = true; + +/** + * The developer group is deprecated, but can be activated if need be + * to use the 'lockdb' and 'unlockdb' special pages. Those require + * that a lock file be defined and creatable/removable by the web + * server. + */ +# $wgGroupPermissions['developer']['siteadmin'] = true; diff --git a/includes/User.php b/includes/User.php index 93bd950e40..4242b81625 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1578,7 +1578,8 @@ class User { $rights = array(); foreach( $groups as $group ) { if( isset( $wgGroupPermissions[$group] ) ) { - $rights = array_merge( $rights, $wgGroupPermissions[$group] ); + $rights = array_merge( $rights, + array_keys( array_filter( $wgGroupPermissions[$group] ) ) ); } } return $rights;