在yii2 / admin中添加规则

I created a Rule using yii2/admin.I attach the rule to Roles.But when I run the page it shows

Forbidden (#403) You are not allowed to perform this action.

Here I show the step That i had done.

Giving Rule To Role

Here I login with the user with The permission

When Selecting the Page

My AuthorRule.php controller

<?php
namespace backend\controllers;
use yiibac\Rule;

class AuthorRule extends Rule
{
public $name = 'contactadmin';
public function execute($user, $item, $params)
{
return isset($params['post']) ?$params['post']->createdBy 
== $user  : false;
}
}
?>