Skip to content

add member to organization #467

@saifulhoque26

Description

@saifulhoque26

GHOrganization class has no method that implements, adding member to organization.

Is there a plan to support this?

Currently these methods are supported:

/**
 * Checks if this organization has the specified user as a member.
 */
public boolean hasMember(GHUser user) {
    try {
        root.retrieve().to("/orgs/" + login + "/members/"  + user.getLogin());
        return true;
    } catch (IOException ignore) {
        return false;
    }
}

/**
 * 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.
 */
public boolean hasPublicMember(GHUser user) {
    try {
        root.retrieve().to("/orgs/" + login + "/public_members/" + user.getLogin());
        return true;
    } catch (IOException ignore) {
        return false;
    }
}

/**
 * Publicizes the membership.
 */
public void publicize(GHUser u) throws IOException {
    root.retrieve().method("PUT").to("/orgs/" + login + "/public_members/" + u.getLogin(), null);
}

Beside, public void remove(GHUser user), option to add is also needed to add in the organization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions