-
Notifications
You must be signed in to change notification settings - Fork 30
Home
Marcus edited this page Feb 27, 2017
·
1 revision
<?php
/**
* Shows _just_ sites that users are explicitly bound to
*
* @author marcus
*/
class MySiteHierarchyExtension extends Extension
{
public function augmentStageChildren(&$staged, $showAll) {
if (Permission::check('ADMIN')) {
return;
}
if (!$this->owner->ID && Controller::curr() instanceof LeftAndMain) {
if ($this->owner instanceof SiteTree) {
$myGroups = Member::currentUser()->Groups();
$ids = $myGroups->column('ID');
$staged = Site::get()->filter('EditorGroups.ID', $ids);
}
}
}
}