Controller Accessrules() And Webuser Checkaccess()

What is the relationship between these two things please? They both seem to do the same thing, provide information as to permission to perform certain actions.

Have a look at this part of the guide for a pretty good breakdown.

In short, accessRules() defines simple rules, which may or may not invoke RBAC. If you want to invoke RBAC directly, such as to alter what’s displayed on screen depending on the user’s privileges, you can use Yii::app()->user->checkAccess().

Thanks. I take it then, if I have accessRule()s in place that I don’t then need to explicitly call checkAccess() in cases like this



    // delete the post


per ?

If I use RBAC, what should I do with my accessRule()s? I don’t really want to have to list, in code, every user which might be an admin, I’d like to do it role based (since the users will change over time). (Sorry, probably basic questions, but I’m new…)

The page I linked you to gives an example of a role based access rule:





Ah, great! Thank you!