Yii 2.0 RBAC - What should I fill in "data" field of "auth_rule" table

I wanna use the example from Guide 2.0 that checks if the "current user is author" of the selected "post".


But I wanna use RBAC from database. So I created the auth_rule table using this SQL:

[b]CREATE TABLE auth_rule (

name varchar(64) NOT NULL,

data text,

created_at int(11) default NULL,

updated_at int(11) default NULL,



And now I’m trying to guess what to fill in “data” column of “auth_rule” table. I tried to put:

return \Yii::$app->user->getId()==$params["post"]->createdBy;

But I’m receiving this error:

[b]PHP Notice – yii\base\ErrorException

unserialize(): Error at offset 0 of 59 bytes[/b]

Can anyone give a direction here? What is expected to be on "data" field of this table? Is there another way to do it?

I don’t wanna use PhpManager to control RBAC.