mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 22:09:48 +08:00
revokeAll() implementation for DbManager
This commit is contained in:
@@ -276,6 +276,18 @@ class DbManager extends Manager
|
||||
->execute() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Revokes all authorization assignments from a user.
|
||||
* @param mixed $userId the user ID (see [[User::id]])
|
||||
* @return boolean whether removal is successful
|
||||
*/
|
||||
public function revokeAll($userId)
|
||||
{
|
||||
return $this->db->createCommand()
|
||||
->delete($this->assignmentTable, ['user_id' => $userId])
|
||||
->execute() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a value indicating whether the item has been assigned to the user.
|
||||
* @param mixed $userId the user ID (see [[User::id]])
|
||||
|
||||
Reference in New Issue
Block a user