What you're basically looking for is a User HABTM Game association with one extra tidbit of information in each association. That's what the "with" parameter is for. There's little documentation for it out there and I haven't used it in Cake yet, but played with the same thing in Rails. Have a look at this article:
http://www.cricava.com/blogs/index.php?blog=6&title=modelizing_habtm_join_tables_in_cakephp_&more=1&c=1&tb=1&pb=1 On 5 Sep 2008, at 11:38, Adrian wrote: > > I have 3 models > > User > Role > Game > > A User can belong to one or more Games. > A Game has one or more Users. > A User has a Role within each Game. > > It's that third association that's escaping me. I think the simplest > way would be to create a 1:1:1 from User:Role:Game and then and a > HABTM from User to Game. Am I off here? > > This is all in preparation to set up an ACL. Where, depending on a > User's Role within a Game, the User can edit, or not, records > belonging to that particular game. In other words if User A has GM > Role in Game X, then the A can edit records relating to X. However A > only has Player Role in Game Y and can view but not edit records > relating to Y. > > Is my original way of thinking about this correct or is there a better > way to accomplish this through Cake? > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
