201 Commits

Author SHA1 Message Date
8005113753 Fix PHPStan errors in yii\rbac\PhpManager (#20588) 2025-10-10 23:01:42 +03:00
e86086d56b Fix #20587: Fix @var annotation for yii\rbac\Item::$ruleName 2025-10-10 23:01:20 +03:00
7ac94cefd6 Fix #20589: Fix @var annotations for yii\rbac\DbManager properties 2025-10-10 23:00:42 +03:00
c82da8dc82 Add visibility for all class elements (#20557) 2025-10-02 01:27:23 +03:00
33ed3218bf Fix #20548: Fix PHP 8.5 null array offset deprecation warnings 2025-09-30 01:31:21 +03:00
8b50a4942a Fix @var tags syntax in framework folder (#20392) 2025-06-03 19:57:08 +03:00
3fa2d61e54 Fix #20175: Fix bad result for pagination when used with GridView 2024-06-08 10:29:40 +03:00
52e4a3e645 release version 2.0.50 2024-05-30 20:23:31 +03:00
e2a167028b Upgrade to PSR12 coding standard (#20121) 2024-03-19 17:21:27 +03:00
37cd13e9c7 Fix #19847: Fix regression introduced in #15376 that caused DbManager::getRolesByUser() to return stale data 2023-05-24 20:21:37 +03:00
7b369576a8 Fix #15376: Added $userId for RBAC roles cache 2022-12-28 19:43:20 +04:00
a97934fd92 Fix #15376: Added cache usage for yii2\rbac\DbManager::getRolesByUser() 2022-12-02 13:45:45 +03:00
394922f804 Fix check for stream return false
c33ef022fe (r89827546)
2022-11-14 12:58:06 +03:00
c33ef022fe Fix #19670: Fix Error null check PHP 8.1 yii\rbac\DbManager 2022-11-14 11:39:41 +03:00
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
a87c02c712 Fix more types (#19333)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect

* Null types for Validator

* Several more null types

* One more

* Make AccessRule::$allow always a boolean

It doesn't have any special null handling, so it's safe to default to false

* Validator::$skipOnEmpty is always a boolean

* Catch all throwable from Widget::widget()

* Don't limit $previous args to \Exception

The actual \Exception allows $previous to be any throwable in PHP 7+

* Add Throwable catch block to Instance::get()

* Throwable cleanup

Comment changes only.

- Document \Throwable instead of \Exception wherever appropriate
- Removed redundant exception/error classes when \Throwable is referenced

* Yii::setlogger() accepts null

* ArrayHelper::removeValue() can remove any type of value

* Change default $allow value to false
2022-04-03 11:20:21 +02:00
4628b91e73 Fix types (#19332)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect
2022-03-30 18:40:10 +02:00
437b0d51aa Fix #19182: RBAC Migration failed when use oracle with oci8 2022-01-21 19:26:52 +03:00
655786b7ed release version 2.0.44 2021-12-30 10:50:56 +03:00
4479c66522 Fixed phpdoc types 2021-03-12 23:41:48 +03:00
4e2045c040 release version 2.0.41 2021-03-04 00:51:35 +03:00
e208a5aa0d Fix #18383: RBAC's generated file made PSR-12 compliant 2020-11-26 16:15:34 +03:00
ccb14ff667 release version 2.0.39 2020-11-10 13:58:35 +03:00
6e694ee249 release version 2.0.38 2020-09-15 00:52:10 +03:00
287476465d Fix #18196: yii\rbac\DbManager::$checkAccessAssignments is now protected 2020-09-08 12:16:39 +03:00
b492476e35 Fix #18189: Fix "Invalid parameter number" in yii\rbac\DbManager::removeItem() (#18190) 2020-07-21 12:27:01 +03:00
24505e7cdd Change SQL in migration for support old version of MSSQL (without IF EXISTS) (#18123) 2020-06-22 18:22:42 +03:00
4c416c7982 Fix #18105: Fix for old trigger in RBAC migration with/without prefixTable 2020-06-15 14:05:58 +03:00
b83f06268f Fix #18041: Fix RBAC migration for MSSQL 2020-06-04 23:12:32 +03:00
3bc919bcbd Fix #16481: Fix RBAC MSSQL trigger 2020-05-02 13:26:30 +03:00
5275473fc9 Bug #17685: up and down methods now using proper "db" component 2019-11-26 22:05:05 +03:00
Poo
439a5c6681 Fix #17657: Fix migration errors from missing $schema in RBAC init file when using MSSQL 2019-11-04 22:40:39 +03:00
dfbf176831 Fix #17522: DbManager::isEmptyUserId() is now protected 2019-08-27 21:05:48 +03:00
2b79a0c5ba Fixes #16945: Fixed RBAC DbManager ruleName fetching on the case of PDO::ATTR_ORACLE_NULLS => PDO::NULL_TO_STRING 2018-12-31 06:43:07 -05:00
eec998faac Fixes #16490: Fix schema on rbac init 2018-10-06 00:59:46 +03:00
b933d61861 Update m170907_052038_rbac_add_index_on_auth_assignment_user_id.php (#16272)
When the authManager DB Connection is not the default one the migration fails
2018-05-30 22:49:41 +03:00
69db550876 Fixed RBAC migration updates (#16330) 2018-05-30 00:12:26 +03:00
9e6d5aa1a8 Fixes #15548: Fixed index names collision in RBAC 2018-05-24 16:29:05 +05:00
abb503c284 release version 2.0.14.1 2018-02-24 22:23:06 +02:00
22832b7c49 release version 2.0.14 2018-02-19 00:27:09 +02:00
3ed5e35701 Fixed PHPDocs, code and tests for #15422 2018-02-19 00:11:13 +02:00
e6f5c46cdc Fixes #15633: Deprecate some things going away/changing in 2.1
- Deprecated `yii\base\BaseObject::className()` in favor of native PHP syntax `::class`, which does not trigger autoloading
- Deprecated XCache and Zend data cache support as caching backends
- Deprecated `yii\BaseYii::powered()` method
- Added `yii\base\InvalidArgumentException` and deprecated `yii\base\InvalidParamException`
- Added `yii\BaseYii::debug()` and deprecated `yii\BaseYii::trace()`
2018-02-11 01:48:29 +03:00
65f6b59b35 @inheritdoc notation changed 2018-01-23 13:11:24 +02:00
e516d64d1e Fixes #15422: Added default roles dynamic definition support via closure for yii\rbac\BaseManager 2018-01-13 21:02:34 +03:00
fb23b0d0ea Code style fixes 2017-11-01 02:43:02 +03:00
324b82c6d8 phpDoc to BaseManager::defaultRoles [skip ci] 2017-10-11 10:36:50 +03:00
d4780559c9 Fixes #14765: RBAC: add index on user_id column in auth_assignment table for performance reasons 2017-09-19 23:35:46 +02:00
711498f93a Cache user assignments to avoid unnecessary DB queries (#14696)
* Cache user assignments to avoid unnecessary DB queries

alternative to #9138 and #10981, only cache on `checkAccess` call which is usually
called on every request. Cache is not necessary in RBAC management.

Similar to #14061 but includes proper cache invalidation and test.

`getAssignments()` always queries the DB. The cache is only applied on
`checkAccess` calls, and invalidated as soon as the RBAC structure is
modified through the manager component (verified by the test case).

Regarding [concerns of memory usage](https://github.com/yiisoft/yii2/pull/14061#issuecomment-297982502)
if used in batch mode on multiple users, you can call
`invalidateCache()` method if this really causes a problem.

fixes #7743
close #9138
close #14061
close #10981

See also
- https://github.com/yiisoft/yii2/issues/7626#issuecomment-77745166
- https://github.com/yiisoft/yii2/pull/14061#issuecomment-319645488

* improve test naming

* fix tests

* fix assignment cache for non-scalar user-ids
2017-09-01 10:50:36 +02:00
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00