yii2-rbac icon indicating copy to clipboard operation
yii2-rbac copied to clipboard

where and how to add rule?

Open pkjoshisbp opened this issue 6 years ago • 0 comments
trafficstars

somewhere in other comments - I saw that Create your own rule class, for example:

class AboutUsRule extends Rule
{
    public $name = 'aboutUsRule';

    public function execute($user, $item, $params)
    {
        // your code here
    }
}

my question is where do I add these rule. as mention there - class - app\rbac\rules\AboutUsRule // in my example if I am trying to create a folder rbac in my site root, and then adding rule there, it is showing the directory listing instead of rbac web interface. when I access mysite/rbac.

note: I am able to add role, permission, assign permission etc. without any issue.

pkjoshisbp avatar Sep 04 '19 19:09 pkjoshisbp