mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Fix #19847: Fix regression introduced in #15376 that caused DbManager::getRolesByUser() to return stale data
This commit is contained in:
@ -882,6 +882,9 @@ class DbManager extends BaseManager
|
||||
])->execute();
|
||||
|
||||
unset($this->checkAccessAssignments[(string) $userId]);
|
||||
|
||||
$this->invalidateCache();
|
||||
|
||||
return $assignment;
|
||||
}
|
||||
|
||||
@ -895,9 +898,13 @@ class DbManager extends BaseManager
|
||||
}
|
||||
|
||||
unset($this->checkAccessAssignments[(string) $userId]);
|
||||
return $this->db->createCommand()
|
||||
$result = $this->db->createCommand()
|
||||
->delete($this->assignmentTable, ['user_id' => (string) $userId, 'item_name' => $role->name])
|
||||
->execute() > 0;
|
||||
|
||||
$this->invalidateCache();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -910,9 +917,13 @@ class DbManager extends BaseManager
|
||||
}
|
||||
|
||||
unset($this->checkAccessAssignments[(string) $userId]);
|
||||
return $this->db->createCommand()
|
||||
$result = $this->db->createCommand()
|
||||
->delete($this->assignmentTable, ['user_id' => (string) $userId])
|
||||
->execute() > 0;
|
||||
|
||||
$this->invalidateCache();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user