Skip to content
GitLab
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
Jul 11, 2018
by
Greg Messner
Browse files
Fixed issue with addLdapGroupLink() (#223).
parent
57754393
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GroupApi.java
View file @
d26ae081
...
@@ -760,11 +760,31 @@ public class GroupApi extends AbstractApi {
...
@@ -760,11 +760,31 @@ public class GroupApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
void
addLdapGroupLink
(
Object
groupIdOrPath
,
String
cn
,
AccessLevel
groupAccess
,
String
provider
)
throws
GitLabApiException
{
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
()
GitLabApiForm
formData
=
new
GitLabApiForm
()
.
withParam
(
"cn"
,
cn
,
true
)
.
withParam
(
"cn"
,
cn
,
true
)
.
withParam
(
"group_
A
ccess"
,
groupAccess
,
true
)
.
withParam
(
"group_
a
ccess"
,
groupAccess
,
true
)
.
withParam
(
"provider"
,
provider
,
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"
);
}
}
/**
/**
...
...
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