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.
Here I login with the user with The permission
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;
}
}
?>