I believe the proper MVC way to do it is to do the check in your
controller and set the variables for you view.  So in your controller
you might have something like this:

if ($this->Acl->check(your acl info)) {
    $this->set('admin', true);
}

Then in your view you would simple check the $admin variable:

if ($admin) {
    You html content.
}

Hope that helps.

On Apr 6, 4:20 am, Faza <f...@ansi.pl> wrote:
> Hello all,
>
> just happily finished setup of group-based ACL in my app, thanks to
> brilliant tutorial on Cake site.
>
> Nevertheless, despite looking around I haven't found any way (known to a
> noob like me) to use a function similiar to $this->Acl->check() in View,
> for, say, hiding certain sections of webpage to non-admin users or
> anything like that. I know, I could do it by saving users group in
> session and checking it in View, but I'm curious if there's some cake
> way to do it.
>
> Thanks!
>
> Regards
> Jacek
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to