I’m learning CakePHP as I’m developing a new app.
I’ve setup user authentication and authorization on different pages.
What I need now is to setup a logic where a user can only edit/view his/her own page.
Right now the URls look like this:
http://domain.com/cakephp/users/view/3
http://domain.com/cakephp/users/edit/3
so if user goes in the location bar and changes 3 to 4, he can access and modify another user data. I must restrict that access.
Any ideas?
thanks in advance
Use the
isAuthorizedmethod from AuthComponent. Check documentation for more information. 🙂Check AuthComponent 2.0 tutorials at YouTube from Andrew Perkins. They are great.