/** * Matches the web User object against the specified platform roles. * * @param \yii\web\User $user * @return bool */ public function matchUserRoles($user) { if (empty($this->userRoles)) { return true; } foreach ($this->userRoles as $role) { if (Role::check($role, $user->getRole())) { return true; } } return false; }