3433 Posts in 1058 Topics by 734 members
|Go to End|
17 January 2009 at 2:18am
According to the upgrade notes for 2.3 on this page : http://doc.silverstripe.com/doku.php?id=upgrading:2.3.0&s=viewersgroup , the Page->ViewersGroup and Page->EditorsGroup have been changed to a many_many relation..
This breaks some functionality in one of our sites and I don't know how to properly make it work in SS 2.3 ...
What I need is a list of all the pages that have a specific "viewersgroup" permission set. In the old situation , I could just do a $GroupPage = DataObject::get_one("Page", "ViewersGroup = '$Group->ID'", "Sort", ""); to get the results.
From 2.3 on , the ViewersGroup DB column is obsolete and replaced by a many-many relation. So basically , I need to do a reverse lookup on these values but I can't figure out how to do it.
Anyone has the answer ?
5 September 2009 at 10:58pm
And, how did you solve it?
Running into the same issue on an old site - current solution I see is rewriting everything using JOINS, but perhaps you found an even easier solution?
7 September 2009 at 8:17pm
I first get the group for the current user : Member->Groups()
Then , I loop through the pages and match their viewergroups against my user group .....
You can do a $page->getManyManyComponents('ViewerGroups') to get a list of all viewergroups for page..
I can probably dig up some code somewhere if you need it .....
|Go to Top|