Re: newbie acl question

2008-04-10 Thread Dardo Sordi Bogado

> basically in my layout ctp file, i have a navigation menu. If an Admin user
> logs in, I want the admin nav menu to appear. Otherwise, do not display the
> admin nav menu. what is the best way to do this? thanks


1. First, determine if the menu should be displayed. This depends on
how you have set up the authentication/authorization system.
2. If so, set adminMenu (or the name you like) to true, else set it to
false. You can even pass an array of the elements that conform the
menu to the view.
3. In the layout:



here comes the admin menu, you can make it static (if it fit's your
application), render an element containing it, or even make a helper
to take care of this.



In order to keep things ordered and flexible, I would go making 1 and
2 in a component, but you can put them in the beforeFilter() of the
AppController.

>
>
>
> On Wed, Apr 9, 2008 at 4:59 PM, Dardo Sordi Bogado <[EMAIL PROTECTED]>
> wrote:
>
> >
> > Probably, I will check in the AppController::beforeFilter(); or even
> > better make a component.
> >
> > Helpers are meant for the view, not the controller.
> >
> > Given the fact that I haven't read your code, and you haven't
> > explained what are you trying to accomplish I can't give you further
> > assistance.
> >
> > What I've suggested was that in the light of MVC, is better not to
> > make ACL checks in the view, and let the view be a mere
> > representational layer, not including business or application logic in
> > it.
> >
> > Maybe you need to review the MVC pattern, and the relevant cakephp
> > documentation.
> >
> > And in order to help you, you need to provide more details about what
> > are you trying to do and what are your reasons to try to make that
> > way.
> >
> > HTH,
> > Dardo Sordi.
> >
> >
> >
> >
> >
> > On Wed, Apr 9, 2008 at 8:45 PM, . <[EMAIL PROTECTED]> wrote:
> > > what controller would i check in for the layout? or use helper?
> > >
> > >
> > >
> > >
> > > On Wed, Apr 9, 2008 at 4:14 AM, Dardo Sordi Bogado
> <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > >
> > > > You don't. Check from controller/component and pass the allowed/denied
> > > > to the view/layout.
> > > >
> > > >
> > > > On Wed, Apr 9, 2008 at 7:19 AM, . <[EMAIL PROTECTED]> wrote:
> > > > > hi how do you check acl from the View? ie $acl->check(...) in the
> view,
> > > > > instead of controller. How would I check ACL from my layout? thanks
> > > > >  >
> > > > >
> > > >
> > > > > >
> > > >
> > >
> >
> >
>
>
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: newbie acl question

2008-04-09 Thread .
basically in my layout ctp file, i have a navigation menu. If an Admin user
logs in, I want the admin nav menu to appear. Otherwise, do not display the
admin nav menu. what is the best way to do this? thanks

On Wed, Apr 9, 2008 at 4:59 PM, Dardo Sordi Bogado <[EMAIL PROTECTED]>
wrote:

>
> Probably, I will check in the AppController::beforeFilter(); or even
> better make a component.
>
> Helpers are meant for the view, not the controller.
>
> Given the fact that I haven't read your code, and you haven't
> explained what are you trying to accomplish I can't give you further
> assistance.
>
> What I've suggested was that in the light of MVC, is better not to
> make ACL checks in the view, and let the view be a mere
> representational layer, not including business or application logic in
> it.
>
> Maybe you need to review the MVC pattern, and the relevant cakephp
> documentation.
>
> And in order to help you, you need to provide more details about what
> are you trying to do and what are your reasons to try to make that
> way.
>
> HTH,
> Dardo Sordi.
>
>
> On Wed, Apr 9, 2008 at 8:45 PM, . <[EMAIL PROTECTED]> wrote:
> > what controller would i check in for the layout? or use helper?
> >
> >
> >
> >
> > On Wed, Apr 9, 2008 at 4:14 AM, Dardo Sordi Bogado <[EMAIL PROTECTED]
> >
> > wrote:
> >
> > >
> > > You don't. Check from controller/component and pass the allowed/denied
> > > to the view/layout.
> > >
> > >
> > > On Wed, Apr 9, 2008 at 7:19 AM, . <[EMAIL PROTECTED]> wrote:
> > > > hi how do you check acl from the View? ie $acl->check(...) in the
> view,
> > > > instead of controller. How would I check ACL from my layout? thanks
> > > >  >
> > > >
> > >
> > > > >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: newbie acl question

2008-04-09 Thread Dardo Sordi Bogado

Probably, I will check in the AppController::beforeFilter(); or even
better make a component.

Helpers are meant for the view, not the controller.

Given the fact that I haven't read your code, and you haven't
explained what are you trying to accomplish I can't give you further
assistance.

What I've suggested was that in the light of MVC, is better not to
make ACL checks in the view, and let the view be a mere
representational layer, not including business or application logic in
it.

Maybe you need to review the MVC pattern, and the relevant cakephp
documentation.

And in order to help you, you need to provide more details about what
are you trying to do and what are your reasons to try to make that
way.

HTH,
Dardo Sordi.


On Wed, Apr 9, 2008 at 8:45 PM, . <[EMAIL PROTECTED]> wrote:
> what controller would i check in for the layout? or use helper?
>
>
>
>
> On Wed, Apr 9, 2008 at 4:14 AM, Dardo Sordi Bogado <[EMAIL PROTECTED]>
> wrote:
>
> >
> > You don't. Check from controller/component and pass the allowed/denied
> > to the view/layout.
> >
> >
> > On Wed, Apr 9, 2008 at 7:19 AM, . <[EMAIL PROTECTED]> wrote:
> > > hi how do you check acl from the View? ie $acl->check(...) in the view,
> > > instead of controller. How would I check ACL from my layout? thanks
> > >  >
> > >
> >
> > > >
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: newbie acl question

2008-04-09 Thread .
what controller would i check in for the layout? or use helper?

On Wed, Apr 9, 2008 at 4:14 AM, Dardo Sordi Bogado <[EMAIL PROTECTED]>
wrote:

>
> You don't. Check from controller/component and pass the allowed/denied
> to the view/layout.
>
> On Wed, Apr 9, 2008 at 7:19 AM, . <[EMAIL PROTECTED]> wrote:
> > hi how do you check acl from the View? ie $acl->check(...) in the view,
> > instead of controller. How would I check ACL from my layout? thanks
> >  >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: newbie acl question

2008-04-09 Thread Dardo Sordi Bogado

You don't. Check from controller/component and pass the allowed/denied
to the view/layout.

On Wed, Apr 9, 2008 at 7:19 AM, . <[EMAIL PROTECTED]> wrote:
> hi how do you check acl from the View? ie $acl->check(...) in the view,
> instead of controller. How would I check ACL from my layout? thanks
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



newbie acl question

2008-04-09 Thread .
hi how do you check acl from the View? ie $acl->check(...) in the view,
instead of controller. How would I check ACL from my layout? thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---