Friday, September 26, 2008

Re: How to allow all non-administrative route with Auth

Hi, i haven't checked this code, but as far as i remember

function beforeFilter() {
if (!isset($this->params[Configure::read('Routing.admin')])) {
$this->Auth->allowedActions = array('*');
}

On Sat, Sep 27, 2008 at 1:58 AM, ORCC <oskarcah@gmail.com> wrote:
>
> I'm using Auth component to manage an admin panel. I use admin route
> for all function in admin panel. In order to allow all other actions
> without login, I add them in beforeFilter method. For instance:
>
> function beforeFilter() {
> parent::beforeFilter(); //Controller general initialization
> $this->Auth->allow('index');
> $this->Auth->allow('price_list');
> ...
> }
>
> But this is error prone when the controller has a lot of actions.
>
> Is there a single instruction with Auth component for allowing all
> actions with non-administrative route?
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

No comments: