Ignore my last post I sent it prematurely.

I am using Auth in 'crud' mode.  I put this in my app_controller:

function beforeFilter()
{
    // this will allow all controller index and view actions to be
shown without any
    // usage of Auth or Acl
    $this->Auth->allowedActions = array('index','view');
}

Then all controller/index and controller/view pages will be shown
without any check or any need to create a session.

To overwrite this inside an individual controller do this:

function beforeFilter()
{
    // this will deny all actions for this controller
    parent::beforeFilter();
    $this->Auth->allowedActions = array();
}



On Mar 24, 4:49 pm, mbavio <[EMAIL PROTECTED]> wrote:
> Tks jonknee, I will take a look to the link. Unfortunately, I also
> have actions in the frontpage that I need to restrict from not
> registered users.
>
> See ya,
> mbavio
>
> On Mar 24, 8:45 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > I believe that's the default behavior in AclComponent for protected
> > > pages.
>
> > I meant AuthComponent :).
>
> > > Another question: where do you set if a page requires a user or admin?
>
> > That belongs under the ACL component, Auth just shows they are indeed
> > logged in. ACL says what they can do. In my setup I only use ACL for
> > admin functions. I wrote a few methods in app_controller that checks
> > the current user against a Aro, so I can say $this-
>
> > >requireAro('admin') to assure that the user is an admin.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to