From cc4849a3aec225749ea9d15270eaad3f04073bd7 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 14 Dec 2015 12:34:00 +0300 Subject: [PATCH] =?UTF-8?q?Renamed=20getUserIDsByRole=20=E2=86=92=20getUse?= =?UTF-8?q?rIdsByRole=20for=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/yiisoft/yii2/commit/0e0079bcae818b86e13a71d4a3cede6765be8bbd#commitcomment-14953758 --- framework/CHANGELOG.md | 2 +- framework/UPGRADE.md | 2 +- framework/rbac/DbManager.php | 2 +- framework/rbac/ManagerInterface.php | 2 +- framework/rbac/PhpManager.php | 2 +- tests/framework/rbac/ManagerTestCase.php | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 7fa9318..2669d36 100644 --- a/framework/CHANGELOG.md +++ b/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) diff --git a/framework/UPGRADE.md b/framework/UPGRADE.md index 1698931..ab673ac 100644 --- a/framework/UPGRADE.md +++ b/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 ---------------------- diff --git a/framework/rbac/DbManager.php b/framework/rbac/DbManager.php index 7bff690..abf6980 100644 --- a/framework/rbac/DbManager.php +++ b/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 []; diff --git a/framework/rbac/ManagerInterface.php b/framework/rbac/ManagerInterface.php index 0d4a251..60aa192 100644 --- a/framework/rbac/ManagerInterface.php +++ b/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. diff --git a/framework/rbac/PhpManager.php b/framework/rbac/PhpManager.php index 0b0ddca..c931417 100644 --- a/framework/rbac/PhpManager.php +++ b/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) { diff --git a/tests/framework/rbac/ManagerTestCase.php b/tests/framework/rbac/ManagerTestCase.php index fca21db..84a1a1c 100644 --- a/tests/framework/rbac/ManagerTestCase.php +++ b/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')); } }