taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
269 stars 162 forks source link

Add X-Redmine-Switch-User parameter to post #279

Closed kgoedert closed 6 years ago

kgoedert commented 7 years ago

Hello,

is there a way to add X-Redmine-Switch-User to the post request to impersonate a user?

alexeyOnGitHub commented 6 years ago

here is code added to Transport class in 2015:

private String send(HttpRequestBase http) throws RedmineException {
        if (onBehalfOfUser != null) {
            http.addHeader("X-Redmine-Switch-User", onBehalfOfUser);
        }
        return communicator.sendRequest(http);
    }

and corresponding code in RedmineManager:

public void setOnBehalfOfUser(String loginName) {
        transport.setOnBehalfOfUser(loginName);
}