Closed Kolyunya closed 8 years ago
@Kolyunya Please provide the code to the reproduce.
@githubjeka the following rule causes the mentioned earlier error. Switching properties to public
"solves" the problem.
namespace app\rbac;
use yii\rbac\Rule;
class TestRule extends Rule
{
public $name = 'rule';
protected $foo;
private $bar;
public function execute($user, $item, $params)
{
return true;
}
}
Which DBMS do you use?
Probably related to https://github.com/yiisoft/yii2/issues/10176
@SilverFire I'm using PostgreSQL
. This issue turns to be a duplicate of the #10176 but it wasn't solved in fact.
@SilverFire I stopped using private and protected fields in Rule classes.
This is not the solution of the problem IMO.
If we can not overcome this limitation, at a very least it must be documented in guide and class reference.
The problem is out of Yii scope: https://bugs.php.net/bug.php?id=53756
@SilverFire if you carefully read the page you referenced you will notice that this is the expected behavior of the PHP interpreter and the problem is right inside the Yii scope. The wrong column type is used to store serialized binary rule data. It must be a binary column, not string.
What steps will reproduce the problem?
Add a RBAC rule with a
private
property viaDbManager
.What is the expected result?
Rule added successfully.
What do you get instead?
Additional info