Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
d26ae081
Commit
d26ae081
authored
7 years ago
by
Greg Messner
Browse files
Options
Download
Email Patches
Plain Diff
Fixed issue with addLdapGroupLink() (#223).
parent
57754393
main
5.0.x
5.0.x.jdk17
6.x
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/gitlab4j/api/GroupApi.java
+22
-2
src/main/java/org/gitlab4j/api/GroupApi.java
with
22 additions
and
2 deletions
+22
-2
src/main/java/org/gitlab4j/api/GroupApi.java
+
22
-
2
View file @
d26ae081
...
...
@@ -760,11 +760,31 @@ public class GroupApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public
void
addLdapGroupLink
(
Object
groupIdOrPath
,
String
cn
,
AccessLevel
groupAccess
,
String
provider
)
throws
GitLabApiException
{
if
(
groupAccess
==
null
)
{
throw
new
RuntimeException
(
"groupAccess cannot be null or empty"
);
}
addLdapGroupLink
(
groupIdOrPath
,
cn
,
groupAccess
.
toValue
(),
provider
);
}
/**
* Adds an LDAP group link.
*
* <pre><code>GitLab Endpoint: POST /groups/:id/ldap_group_links</code></pre>
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
* @param cn the CN of a LDAP group
* @param groupAccess the minimum access level for members of the LDAP group
* @param provider the LDAP provider for the LDAP group
* @throws GitLabApiException if any exception occurs
*/
public
void
addLdapGroupLink
(
Object
groupIdOrPath
,
String
cn
,
Integer
groupAccess
,
String
provider
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
"cn"
,
cn
,
true
)
.
withParam
(
"group_
A
ccess"
,
groupAccess
,
true
)
.
withParam
(
"group_
a
ccess"
,
groupAccess
,
true
)
.
withParam
(
"provider"
,
provider
,
true
);
post
(
Response
.
Status
.
NO_CONTENT
,
formData
,
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"ldap_group_links"
);
post
(
Response
.
Status
.
CREATED
,
formData
,
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"ldap_group_links"
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets