Index: trunk/extensions/CentralAuth/SpecialGlobalGroupMembership.php |
— | — | @@ -7,13 +7,9 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | class SpecialGlobalGroupMembership extends UserrightsPage { |
11 | | - var $mGlobalUser; |
12 | 11 | function SpecialGlobalGroupMembership() { |
13 | 12 | SpecialPage::SpecialPage( 'GlobalGroupMembership' ); |
14 | 13 | wfLoadExtensionMessages('SpecialCentralAuth'); |
15 | | - |
16 | | - global $wgUser; |
17 | | - $this->mGlobalUser = CentralAuthUser::getInstance( $wgUser ); |
18 | 14 | } |
19 | 15 | |
20 | 16 | /** |
— | — | @@ -48,16 +44,10 @@ |
49 | 45 | |
50 | 46 | function changeableGroups() { |
51 | 47 | global $wgUser; |
52 | | - |
53 | | - ## Should be a global user |
54 | | - if (!$this->mGlobalUser->exists() || !$this->mGlobalUser->isAttached()) { |
55 | | - return array(); |
56 | | - } |
57 | | - |
| 48 | + |
58 | 49 | $allGroups = CentralAuthUser::availableGlobalGroups(); |
59 | | - |
60 | | - ## Permission MUST be gained from global rights. |
61 | | - if ( $this->mGlobalUser->hasGlobalPermission( 'globalgroupmembership' ) ) { |
| 50 | + |
| 51 | + if ( $wgUser->isAllowed( 'globalgroupmembership' ) ) { |
62 | 52 | #specify addself and removeself as empty arrays -- bug 16098 |
63 | 53 | return array( 'add' => $allGroups, 'remove' => $allGroups, 'add-self' => array(), 'remove-self' => array() ); |
64 | 54 | } else { |
Index: trunk/extensions/CentralAuth/SpecialGlobalGroupPermissions.php |
— | — | @@ -31,16 +31,8 @@ |
32 | 32 | wfLoadExtensionMessages('SpecialCentralAuth'); |
33 | 33 | } |
34 | 34 | |
35 | | - function userCanExecute($user) { |
36 | | - $globalUser = CentralAuthUser::getInstance( $user ); |
37 | | - |
38 | | - ## Should be a global user |
39 | | - if (!$globalUser->exists() || !$globalUser->isAttached()) { |
40 | | - return false; |
41 | | - } |
42 | | - |
43 | | - ## Permission MUST be gained from global rights. |
44 | | - return $globalUser->hasGlobalPermission( 'globalgrouppermissions' ); |
| 35 | + function userCanExecute( $user ) { |
| 36 | + return $user->isAllowed( 'globalgrouppermissions' ); |
45 | 37 | } |
46 | 38 | |
47 | 39 | function execute( $subpage ) { |
Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -182,6 +182,8 @@ |
183 | 183 | $wgAvailableRights[] = 'globalgrouppermissions'; |
184 | 184 | $wgAvailableRights[] = 'globalgroupmembership'; |
185 | 185 | $wgGroupPermissions['steward']['centralauth-admin'] = true; |
| 186 | +$wgGroupPermissions['steward']['globalgrouppermissions'] = true; |
| 187 | +$wgGroupPermissions['steward']['globalgroupmembership'] = true; |
186 | 188 | $wgGroupPermissions['*']['centralauth-merge'] = true; |
187 | 189 | |
188 | 190 | $wgSpecialPages['CentralAuth'] = 'SpecialCentralAuth'; |