How to updateOwnPost on function in yii2-admin

I used yii2-admin. All roles and permissions added in browser. (/localhost/yiiproject/site/admin/)

Now my problem is how to add updateOwnPost. I allready read github.com/yiisoft/yii2/blob/master/docs/guide/security-authorization.md.

I don’t have RbacController. Where i add under code.


$auth = Yii::$app->authManager;


        // add the rule

        $rule = new \app\rbac\AuthorRule;

        $auth->add($rule);


        // add the "updateOwnPost" permission and associate the rule with it.

        $updateOwnPost = $auth->createPermission('updateOwnPost');

        $updateOwnPost->description = 'Update own post';

        $updateOwnPost->ruleName = $rule->name;

        $auth->add($updateOwnPost);


        // "updateOwnPost" will be used from "updatePost"

        $auth->addChild($updateOwnPost, $updatePost);


        // allow "author" to update their own posts

        $auth->addChild($author, $updateOwnPost);

Please reply and thanks.