Browse Source

revokeAll() implementation for DbManager

tags/2.0.0-beta
Panagiotis Moustafellos 11 years ago
parent
commit
234feabaac
  1. 12
      framework/yii/rbac/DbManager.php

12
framework/yii/rbac/DbManager.php

@ -277,6 +277,18 @@ class DbManager extends Manager
}
/**
* 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]])
* @param string $itemName the item name

Loading…
Cancel
Save