Browse Source

Adjusted rbac ManagerInterface

tags/2.0.0-rc
Alexander Makarov 10 years ago
parent
commit
ed533172d7
  1. 2
      framework/rbac/DbManager.php
  2. 4
      framework/rbac/ManagerInterface.php
  3. 2
      framework/rbac/PhpManager.php

2
framework/rbac/DbManager.php

@ -595,7 +595,7 @@ class DbManager extends BaseManager
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function assign($role, $userId, $rule = null) public function assign($role, $userId)
{ {
$assignment = new Assignment([ $assignment = new Assignment([
'userId' => $userId, 'userId' => $userId,

4
framework/rbac/ManagerInterface.php

@ -165,12 +165,10 @@ interface ManagerInterface
* *
* @param Role $role * @param Role $role
* @param string|integer $userId the user ID (see [[\yii\web\User::id]]) * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
* @param Rule $rule the rule to be associated with this assignment. If not null, the rule
* will be executed when [[allow()]] is called to check the user permission.
* @return Assignment the role assignment information. * @return Assignment the role assignment information.
* @throws \Exception if the role has already been assigned to the user * @throws \Exception if the role has already been assigned to the user
*/ */
public function assign($role, $userId, $rule = null); public function assign($role, $userId);
/** /**
* Revokes a role from a user. * Revokes a role from a user.

2
framework/rbac/PhpManager.php

@ -223,7 +223,7 @@ class PhpManager extends BaseManager
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function assign($role, $userId, $ruleName = null) public function assign($role, $userId)
{ {
if (!isset($this->items[$role->name])) { if (!isset($this->items[$role->name])) {
throw new InvalidParamException("Unknown role '{$role->name}'."); throw new InvalidParamException("Unknown role '{$role->name}'.");

Loading…
Cancel
Save