26 January 2011 at 10:31am
Currently, i am working on a project that requires using subsite moudel and modeladmin.
I just wonder is that possible to only see the current subsite data in module admin tab.
The logic is:
one subsite admin(not global admin) login to their own subsite, and click on MyModelAdmin Tab on the top CMS navigation, then it will be able to generate the data of managed_models with in current Subsite.
I have looked in ModelAdmin.php, but not sure how could i add the subsite restriction code in?!
I don't have an out of the box solution, however I'd advise that you do something akin to translatable.
1) decorate all your dataobjects to have the (hidden) field for the relevant subsite
2) agument all SQL to get those relevant to the current subsite
3) do somethign like https://github.com/silverstripe-labs/silverstripe-translatablemodeladmin to the Model admin