I would imagine something like the following if you wanted something very simple.
groups id | name | ... users id | ... groups_users id | group_id | user_id | admin | created | modified The groups_users table would be a HasMany Through rather than HasAndBelongsToMany relationship so you can store admin as a tinyint(1), this way the original user who creates the group will have admin set to 1 and the other users invited would default to 0. You can create logic to specify admin rights in a very simple way, though there are more complicated (and possibly effective) ways to do this depending on what you need. http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasmany-through-the-join-model On 20 June 2014 17:40, Salines <[email protected]> wrote: > Okay friends, I need the following: > > enables registered members to dynamically generate user groups, where only > members of the group can access content within that group. This is > identical to do facebook group. > > So I need some logic, how to do it. thanks > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/cake-php. > For more options, visit https://groups.google.com/d/optout. > -- Kind Regards Stephen Speakman -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
