title: Yii2 - RBAC rule to allow/view own data
body: <p>I have installed <code>yii2mod/yii2-rbac</code> from this url - <a href="https://github.com/yii2mod/yii2-rbac" rel="nofollow noreferrer">https://github.com/yii2mod/yii2-rbac</a> in yii2-basic.</p>
  
  <p>everything is working fine except using/allowing owner data.</p>
  
  <p>from this link:<a href="https://www.yiiframework.com/doc/guide/2.0/en/security-authorization" rel="nofollow noreferrer">https://www.yiiframework.com/doc/guide/2.0/en/security-authorization</a>
  I have created a folder in root <code>rbac</code> and file <code>AuthorRule.php</code> and code:</p>
  
  <pre><code>namespace app\rbac;
  
  use yii\rbac\Rule;
  
  //use app\models\Post;
  
  /**
   * Checks if authorID matches user passed via params
   */
  class AuthorRule extends Rule
  {
      /**
       * @var string
       */
      public $name = 'isAuthor';
  
      /**
       * @param string|int $user the user ID.
       * @param Item $item the role or permission that this rule is associated with
       * @param array $params parameters passed to ManagerInterface::checkAccess().
       * @return bool a value indicating whether the rule permits the role or permission it is associated with.
       */
      public function execute($user, $item, $params)
      {
          return isset($params['post']) ? $params['post']-&gt;createdBy == $user : false;
      }
  }
  </code></pre>
  
  <p>but when I try to add the rule in permission(either <code>AuthorRule</code> or <code>isAuthor</code> under permission I created updateOwnRecord, I am getting the error, the rule doesn't exist.</p>
  
  <p>What I am missing here?</p>