When writing rules for access control in yii controllers, possible parameters to be set for a rule are 'action' - sets to which action the rule applies; 'users', 'roles', etc.
Now, both the yii guide (pdf) and reference (I have chm file) say that it's possible to set, also, a controller id for the controller the rule should apply to.
Now, if we are already putting these rules in a controller class/file, how would we be able to put some other controller (other than the current one) as the parameter here, meaning how would some other controller whose id we mention here - how would it know there is a rule that applies to it, since it's written in a completely other controller class/file?
How would the controller be aware of a rule that mentions it, if it's written outside of it, in a completely different controller?
You can hook into CWebApplication::beforeControllerAction() to apply filters before the controller even gets the request.
~thinkt4nk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With