Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Member/Group relationship

Go to End

3 Posts   1010 Views


Community Member, 10 Posts

7 January 2012 at 12:53am

Brief Question: Is it possible (or advisable) to change the relationship between Member and Group to one-to-many from many-to-many?

Detail: I'm building my first website, and using silverstripe to do it. The site will have a large number (hopefully!) of members, who will be split into two categories, client and supplier. The two sets will be completely distinct (except for a couple of special case admins), and see different sides of the website. For example different user profiles, different pages, different tools. Ideally there would be a field in the Member object (added via a decorator) indicating which of these groups the member belongs to.

I know this is mostly possible with the many-to-many relationship, just by querying whether the member has the relationship with the first group and if not assuming the relationship is with the other group. But it doesn't seem very elegant. There is a possibility of a user being added to both or neither group for example.

Any advice would be appreciated.



Forum Moderator, 1899 Posts

7 January 2012 at 1:00am

Hi jayslippy,

Welcome to the Forums!

My advice would be - do not mess with anything in the core - especially something within the security section!
I've got thousands of members on a site and use a decorator for any custom functionality is fine to show one thing to some and and something else to others.


Community Member, 10 Posts

7 January 2012 at 8:12am

That's a good point, I'll take your advice. Thanks for the quick response.