follow up fix to the pull request #28

This commit is contained in:
Kohsuke Kawaguchi
2013-01-06 16:24:28 -08:00
parent 560e3c257a
commit 2e074b5bc4
3 changed files with 33 additions and 15 deletions

View File

@@ -69,6 +69,20 @@ public class GHUser extends GHPerson {
return new GHPersonSet<GHUser>(Arrays.asList(wrap(followers,root)));
}
/**
* Returns true if this user belongs to the specified organization.
*/
public boolean isMemberOf(GHOrganization org) {
return org.hasMember(this);
}
/**
* Returns true if this user belongs to the specified organization as a public member.
*/
public boolean isPublicMemberOf(GHOrganization org) {
return org.hasPublicMember(this);
}
/*package*/ static GHUser[] wrap(GHUser[] users, GitHub root) {
for (GHUser f : users)
f.root = root;