Setting up initialization values to components, AuthComponent
Hello people!
I'm facing a problem with Auth component. I've a minor level of
security in my site, that is checked in the isAuthorized() method of
my AppController. I've there a simple switch that checks some options.
The thing is that i need to declare a beforeFilter() in every
controller and set inside that method the following statement
"$this->Auth->authorize = 'controller'" to get Auth to call
isAuthorized.
I was wondering if there's some way of made that call "application
wide". I mean, anyway to initialize the Auth component, where to do
it, to make that (authorize = controller) the default. I tryied to do
that in the method beforeFilter() of my AppController class, but it's
not working.
Altought i've found a way, that is to make this call on AppController
beforeFilter() method:
$this->Auth->isAuthorized('controller',$this);
It works, but don't think it's a good way to do this. I've seen in the
AuthComponent that there are some interesting methods that should be
useful: initialize() and startup()
Does anyone where to call them?
Thanks everybody!
--
Santiago Basulto.-
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home