From 769cdc73e76a4a7c07d4cf8fe8edb686977f4276 Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Wed, 2 Apr 2014 18:45:23 +0100 Subject: [PATCH] Add support for removing a user from an Organisation --- src/main/java/org/kohsuke/github/GHOrganization.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java index b354d486dd..8501ba3763 100644 --- a/src/main/java/org/kohsuke/github/GHOrganization.java +++ b/src/main/java/org/kohsuke/github/GHOrganization.java @@ -57,6 +57,14 @@ public boolean hasMember(GHUser user) { } } + /** + * Remove a member of the organisation - which will remove them from + * all teams, and remove their access to the organization’s repositories. + */ + public void remove(GHUser user) throws IOException { + root.retrieve().method("DELETE").to("/orgs/" + login + "/members/" + user.getLogin()); + } + /** * Checks if this organization has the specified user as a public member. */