Like this:
*AppController*
public $components = array(
'Acl',
'Auth' => array(
'loginAction' => '/',
'loginRedirect' => '/users/dashboard',
'logoutRedirect' =>
array('admin'=>false,'controller'=>'pages','action'=>'home'),
'autoRedirect' => false,
'authorize' => array(
'Actions' => array(
'actionPath' => 'controllers'
)
),
'authError' => 'No access',
),
'Session',
'Security',
'Cookie'
);
public function beforeFilter() {
// unquoting this line will cause App to crash
// $this->Auth->allow('TellaFriend')
}
*PageController*
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('home','view');
}
And using cake 2.3 beta
So? Doing anything wrong?
-Tom
kl. 20:20:52 UTC+1 fredag 23. november 2012 skrev cricket følgende:
>
> On Fri, Nov 23, 2012 at 5:37 AM, MetZ <[email protected] <javascript:>>
> wrote:
> >
> > So, what to put where?
> >
> > eg: PageController
> > $this->allowedActions = array_merge($this->allowedActions, $args);
>
> No, no. This line is from AuthComponent. I just mentioned it to point
> out that calling allow() in AppController *and* your regular
> controller should work just fine.
>
> So how are you initialising Auth? In the $components array or in
> beforeFilter()?
>
> What you want to do is possible so you've probably either got
> something misconfigured somewhere or you're calling something
> where/when you shouldn't be.
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.