Commit be6b259c by Qiang Xue

A better fix.

parent 993339f0
......@@ -495,11 +495,10 @@ abstract class Application extends Module
/**
* Returns the auth manager for this application.
* @return \yii\rbac\Manager the auth manager for this application.
* Null will be returned if "authManager" is not installed.
*/
public function getAuthManager()
{
return $this->get('authManager', false);
return $this->get('authManager');
}
/**
......
......@@ -137,10 +137,14 @@ class AccessRule extends Component
return true;
}
foreach ($this->roles as $role) {
if ($role === '?' && $user->getIsGuest()) {
return true;
} elseif ($role === '@' && !$user->getIsGuest()) {
return true;
if ($role === '?') {
if ($user->getIsGuest()) {
return true;
}
} elseif ($role === '@') {
if (!$user->getIsGuest()) {
return true;
}
} elseif ($user->checkAccess($role)) {
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment