Your life would be soo much easier if you were using cake's ACL in your application. It handles all of the stuff you are trying to do automagically. It can be a little intimidating for new users but once you figure it out you will never use anything else again. Here is a great 2 part tutorial from one of Cake PHP's developers http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1
On Jul 20, 6:29 am, "Mike Karthauser" <[email protected]> wrote: > hi Petter; > > On Tue, July 20, 2010 9:12 am, Petter Andreas Str m wrote: > > Well, I have to explain the topic for the discussion too; > > > I'm looking for a solution where I can make a function to check if > > user have this capability like if(userHasCap('user_edit')). How can i > > make a function like this and include it into every view i need it? > > Component? > > you could do this in a view helper if you are expecting logic to go into a > view page (.ctp). > > ideally the logic should go in the action for the view in which case you > could either use a component or more simply just a function in > app_controller which will make it available to each controller. > > -- > Mike Karthauser > Managing Director - Brightstorm Ltd > > Email: [email protected] > Web:http://www.brightstorm.co.uk > Tel: 07939 252144 (mobile) > Fax: 0870 1320560 > > Address: 1 Brewery Court, North Street, Bristol, BS3 1JS Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
