> $this->Auth->deny('admin', 'accnt', 'faq'); // does not work
This doesn't work because the 'action' for all views in the pages
controller is 'display' not 'admin', 'accnt'
$this->Auth->deny("display") would work, but it would deny ALL views
handled by the pages controller.
Your workaround is a good compromise. Or you could make your own
dedicated MyPagesController to group all these pages together.
On Sep 24, 11:12 am, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
> S'ok, I created 'fake' functions in the user controller, then added
> the views to the users views, then take the Authentication process
> from the app_controller to the users_controller..
>
> On Wed, Sep 24, 2008 at 10:54 AM, gabriel <[EMAIL PROTECTED]> wrote:
>
> > This is my current code:
> > class AppController extends Controller {
>
> > var $components = array('Auth');
>
> > function beforeFilter() {
> > $this->Auth->authorize = 'controller';
> > $this->Auth->allow('*');
> > $this->Auth->deny('admin', 'accnt', 'faq'); // does not work
> > }
>
> > function isAuthorized() {
> > if ($this->Auth->user('role') == 'admin') {
> > $this->Auth->allow('admin');
> > }
>
> > }
> > }
>
> > What I want to do is something like the following:
> > function beforeFilter() {
>
> > $this->Auth->authorize = 'controller';
> > $this->Auth->allow('pages/faq', 'pages/aboutus', 'users/
> > register');
> > $this->Auth->deny('pages/accnt', 'pages/admin', 'categories/
> > edit');
> > }
>
> > function isAuthorized() {
> > if ($this->Auth->user('role') == 'admin') {
> > $this->Auth->allow('pages/admin', 'categories/edit');
> > }
> > $this->Auth->allow('pages/accnt');
> > }
> > }
>
> > NOTE: the pages does not have a model or controller..I HAVE read the
> > cookbooks severaltimes, served the Cakegroup, posted several message,
> > got different replies, but just can' t seem to find a answer to
> > this... I would be grateful if someone can actually show me ..
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---