Commit a7d8236d authored by Jeremie Bresson's avatar Jeremie Bresson
Browse files

Merge remote-tracking branch 'origin/main' into 6.x

parents 83233b5d 6a3839bc
...@@ -169,6 +169,36 @@ public class UserApi extends AbstractApi { ...@@ -169,6 +169,36 @@ public class UserApi extends AbstractApi {
return (getActiveUsers(getDefaultPerPage()).stream()); return (getActiveUsers(getDefaultPerPage()).stream());
} }
/**
* Approves the specified user. Available only for admin.
*
* <pre><code>GitLab Endpoint: POST /users/:id/approve</code></pre>
*
* @param userId the ID of the user to approve
* @throws GitLabApiException if any exception occurs
*/
public void approveUser(Long userId) throws GitLabApiException {
if (userId == null) {
throw new RuntimeException("userId cannot be null");
}
post(Response.Status.CREATED, (Form) null, "users", userId, "approve");
}
/**
* Rejects specified user that is pending approval. Available only for administrators.
*
* <pre><code>GitLab Endpoint: POST /users/:id/reject</code></pre>
*
* @param userId the ID of the user to reject
* @throws GitLabApiException if any exception occurs
*/
public void rejectUser(Long userId) throws GitLabApiException {
if (userId == null) {
throw new RuntimeException("userId cannot be null");
}
post(Response.Status.OK, (Form) null, "users", userId, "reject");
}
/** /**
* Blocks the specified user. Available only for admin. * Blocks the specified user. Available only for admin.
* *
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment