Grant, I'm wondering how you can encorporate this functionality in all your controller actions. For instance, if i have an edit action, then the id gets passed in to that function as its in the url. However, in an add operation there is no current id yet. Thus, i can't call this user defined function in beforeFilter because its only relevant for some of the controller actions.. I could keep an array of all controller actions that need to check this.. but that doesnt seem too great.. I just put a little if statement at the top of each action that needs to call the function. This seems to work but not all that elegant. I havent encorporated any form of full fledged access control yet. I don't really think its needed when all i have to check is that a session id is set.
On Jun 17, 5:28 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > I would keep the functionality in separate controllers, not bloat your > Users one just because you want to access the User model. To ensure > that users cannot view/edit someone elses data you just need to > incorporate this into whatever ACL you use. For our application I > have a function in app_model called isUserOwned( $user_id, $row_id ), > which just does a lookup to see if the requested row is owned by the > passed user id. This can easily be included in all my controller > actions before allowing the request to proceed. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
