Browse Source

Renamed getUserIDsByRole → getUserIdsByRole for consistency

See 0e0079bcae (commitcomment-14953758)
tags/2.0.7
Alexander Makarov 9 years ago
parent
commit
cc4849a3ae
  1. 2
      framework/CHANGELOG.md
  2. 2
      framework/UPGRADE.md
  3. 2
      framework/rbac/DbManager.php
  4. 2
      framework/rbac/ManagerInterface.php
  5. 2
      framework/rbac/PhpManager.php
  6. 8
      tests/framework/rbac/ManagerTestCase.php

2
framework/CHANGELOG.md

@ -59,7 +59,7 @@ Yii Framework 2 Change Log
- Enh #9337: Added `yii\db\ColumnSchemaBuilder::defaultExpression()` to support DB Expression as default value (kotchuprik)
- Enh #9465: ./yii migrate/create now generates code based on migration name and --fields (pana1990)
- Enh #9476: Added DI injection via controller action method signature (mdmunir)
- Enh #9573: Added `yii\rbac\ManagerInterface::getUserIDsByRole()` and implementations (samdark)
- Enh #9573: Added `yii\rbac\ManagerInterface::getUserIdsByRole()` and implementations (samdark)
- Enh #9635: Added default CSS class for `\yii\grid\ActionColumn` header (arogachev, dynasource)
- Enh #9643: Added migrations for DB cache (mdmunir)
- Enh #9711: Added `yii\widgets\LinkPager::$pageCssClass` that allows to set default page class (ShNURoK42)

2
framework/UPGRADE.md

@ -36,7 +36,7 @@ the event.
with global variable `yii` instead.
* Traversable objects are now formatted as arrays in XML response to support SPL objects and Generators. Previous
behavior could be turned on by setting `XmlResponseFormatter::$useTraversableAsArray` to `false`.
* If you've implemented `yii\rbac\ManagerInterface` you need to implement additional method `getUserIDsByRole($roleName)`.
* If you've implemented `yii\rbac\ManagerInterface` you need to implement additional method `getUserIdsByRole($roleName)`.
Upgrade from Yii 2.0.5
----------------------

2
framework/rbac/DbManager.php

@ -963,7 +963,7 @@ class DbManager extends BaseManager
* returned if role is not assigned to any user.
* @since 2.0.7
*/
public function getUserIDsByRole($roleName)
public function getUserIdsByRole($roleName)
{
if (empty($roleName)) {
return [];

2
framework/rbac/ManagerInterface.php

@ -216,7 +216,7 @@ interface ManagerInterface
* @return array array of user ID strings
* @since 2.0.7
*/
public function getUserIDsByRole($roleName);
public function getUserIdsByRole($roleName);
/**
* Removes all authorization data, including roles, permissions, rules, and assignments.

2
framework/rbac/PhpManager.php

@ -813,7 +813,7 @@ class PhpManager extends BaseManager
/**
* @inheritdoc
*/
public function getUserIDsByRole($roleName)
public function getUserIdsByRole($roleName)
{
$result = [];
foreach ($this->assignments as $userID => $assignments) {

8
tests/framework/rbac/ManagerTestCase.php

@ -307,9 +307,9 @@ abstract class ManagerTestCase extends TestCase
$this->auth = $this->createManager();
$this->assertEquals([], $this->auth->getUserIDsByRole('nonexisting'));
$this->assertEquals(['reader A', '123'], $this->auth->getUserIDsByRole('reader'), '', 0.0, 10, true);
$this->assertEquals(['author B'], $this->auth->getUserIDsByRole('author'));
$this->assertEquals(['admin C'], $this->auth->getUserIDsByRole('admin'));
$this->assertEquals([], $this->auth->getUserIdsByRole('nonexisting'));
$this->assertEquals(['reader A', '123'], $this->auth->getUserIdsByRole('reader'), '', 0.0, 10, true);
$this->assertEquals(['author B'], $this->auth->getUserIdsByRole('author'));
$this->assertEquals(['admin C'], $this->auth->getUserIdsByRole('admin'));
}
}

Loading…
Cancel
Save