src/Multisites.php
public function sitesManagedByMember($member = null)
    {
        $member = $member ?: Member::currentUser();
        if (!$member) return array();

        $sites = Site::get();

        if (Permission::check('ADMIN')) {
            return $sites->column('ID');
        }

        $memberGroups = $member->Groups()->column('ID');
        $sites        = $sites->filter("EditorGroups.ID:ExactMatch", $memberGroups);

        return $sites->column('ID');
    }
public function sitesManagedByMember($member = null)
    {
        $member = $member ?: Member::currentUser();
        if (!$member) return array();

        $sites = Site::get();

        if (Permission::check('ADMIN')) {
            return $sites->column('ID');
        }

        $memberGroups = $member->Groups()->column('ID');
        $sites        = $sites->filter("EditorGroups.ID:ExactMatch", $memberGroups);

        return $sites->column('ID');
    }
public function sitesManagedByMember ( $ member = null ) { $ member = $ member ? : Member :: currentUser ( ) ; if ( ! $ member ) return array ( ) ; $ sites = Site :: get ( ) ; if ( Permission :: check ( 'ADMIN' ) ) { return $ sites -> column ( 'ID' ) ; } $ memberGroups = $ member -> Groups ( ) -> column ( 'ID' ) ; $ sites = $ sites -> filter ( "EditorGroups.ID:ExactMatch" , $ memberGroups ) ; return $ sites -> column ( 'ID' ) ; }
Finds sites that the given member is a "Manager" of
A manager is currently defined by a Member who has edit access to a Site Object
@var Member $member
@return array - Site IDs
Finds sites that the given member is a Manager of A manager is currently defined by a Member who has edit access to a Site Object