package com.gh4a.loader;

import java.io.IOException;
import java.util.List;

import org.eclipse.egit.github.core.User;
import org.eclipse.egit.github.core.service.OrganizationService;

import android.content.Context;

import com.gh4a.Gh4Application;

public class OrganizationListLoader extends BaseLoader<List<User>> {
    private String mUserLogin;

    public OrganizationListLoader(Context context, String userLogin) {
        super(context);
        mUserLogin = userLogin;
    }

    @Override
    public List<User> doLoadInBackground() throws IOException {
        OrganizationService orgService = (OrganizationService)
                Gh4Application.get().getService(Gh4Application.ORG_SERVICE);
        return orgService.getOrganizations(mUserLogin);
    }
}

@@ -558,16 +558,67 @@
 ption %7B%0A
+        Gh4Application app = Gh4Application.get();%0A
         
@@ -688,36 +688,19 @@
         
-Gh4Application.get()
+app
 .getServ
@@ -732,16 +732,140 @@
 RVICE);%0A
+        if (mUserLogin.equals(app.getAuthLogin())) %7B%0A            return orgService.getOrganizations();%0A        %7D else %7B%0A    
         
@@ -912,16 +912,26 @@
 Login);%0A
+        %7D%0A
     %7D%0A%7D%0A

Include private organization memberships for logged in user.