Actually, revert r32370. It might be a good idea, but it breaks the UserGetRights hook (more than it already is). Could use some more thought.
This commit is contained in:
parent
73c025c25c
commit
b9a8ffba8b
3 changed files with 7 additions and 10 deletions
|
|
@ -165,4 +165,4 @@ class MWNamespace {
|
|||
return $index >= NS_MAIN;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1387,7 +1387,7 @@ class Title {
|
|||
* @todo fold these checks into userCan()
|
||||
*/
|
||||
public function userCanRead() {
|
||||
global $wgUser;
|
||||
global $wgUser, $wgGroupPermissions;
|
||||
|
||||
$result = null;
|
||||
wfRunHooks( 'userCan', array( &$this, &$wgUser, 'read', &$result ) );
|
||||
|
|
@ -1395,6 +1395,10 @@ class Title {
|
|||
return $result;
|
||||
}
|
||||
|
||||
# Shortcut for public wikis, allows skipping quite a bit of code
|
||||
if ($wgGroupPermissions['*']['read'])
|
||||
return true;
|
||||
|
||||
if( $wgUser->isAllowed( 'read' ) ) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1770,16 +1770,9 @@ class User {
|
|||
* @return boolean True: action is allowed, False: action should not be allowed
|
||||
*/
|
||||
function isAllowed($action='') {
|
||||
global $wgGroupPermissions;
|
||||
if( $action === '' ) {
|
||||
if ( $action === '' )
|
||||
// In the spirit of DWIM
|
||||
return true;
|
||||
}
|
||||
if( !empty( $wgGroupPermissions['*'][$action] ) ) {
|
||||
# Permissions are additive, so there's no need to unstub the User
|
||||
# object in this case.
|
||||
return true;
|
||||
}
|
||||
|
||||
return in_array( $action, $this->getRights() );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue