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
b87da212
Commit
b87da212
authored
Jun 14, 2018
by
Greg Messner
Browse files
Deprecated MASTER and added MAINTAINER access level (#198).
parent
3b857649
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProtectedBranchesApi.java
View file @
b87da212
...
...
@@ -53,7 +53,7 @@ public class ProtectedBranchesApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public
ProtectedBranch
protectBranch
(
Integer
projectId
,
String
branchName
)
throws
GitLabApiException
{
return
protectBranch
(
projectId
,
branchName
,
AccessLevel
.
MA
ST
ER
,
AccessLevel
.
MA
ST
ER
);
return
protectBranch
(
projectId
,
branchName
,
AccessLevel
.
MA
INTAIN
ER
,
AccessLevel
.
MA
INTAIN
ER
);
}
/**
...
...
@@ -63,8 +63,8 @@ public class ProtectedBranchesApi extends AbstractApi {
*
* @param projectId the ID of the project to protect
* @param branchName the name of the branch to protect
* @param pushAccessLevel Access levels allowed to push (defaults: 40, ma
st
er access level)
* @param mergeAccessLevel Access levels allowed to merge (defaults: 40, ma
st
er access level)
* @param pushAccessLevel Access levels allowed to push (defaults: 40, ma
intain
er access level)
* @param mergeAccessLevel Access levels allowed to merge (defaults: 40, ma
intain
er access level)
* @return the branch info for the protected branch
* @throws GitLabApiException if any exception occurs
*/
...
...
src/main/java/org/gitlab4j/api/models/AccessLevel.java
View file @
b87da212
...
...
@@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
public
enum
AccessLevel
{
INVALID
(-
1
),
NONE
(
0
),
GUEST
(
10
),
REPORTER
(
20
),
DEVELOPER
(
30
),
MASTER
(
40
),
OWNER
(
5
0
);
INVALID
(-
1
),
NONE
(
0
),
GUEST
(
10
),
REPORTER
(
20
),
DEVELOPER
(
30
),
@Deprecated
MASTER
(
40
),
MAINTAINER
(
40
),
OWNER
(
50
),
ADMIN
(
6
0
);
public
final
Integer
value
;
...
...
@@ -18,10 +18,13 @@ public enum AccessLevel {
this
.
value
=
value
;
}
private
static
Map
<
Integer
,
AccessLevel
>
valuesMap
=
new
HashMap
<
Integer
,
AccessLevel
>(
6
);
private
static
Map
<
Integer
,
AccessLevel
>
valuesMap
=
new
HashMap
<
Integer
,
AccessLevel
>(
9
);
static
{
for
(
AccessLevel
accessLevel
:
AccessLevel
.
values
())
valuesMap
.
put
(
accessLevel
.
value
,
accessLevel
);
// Make sure MAINTAINER is mapped to 40 and not MASTER (MASTER is deprecated)
valuesMap
.
put
(
MAINTAINER
.
value
,
MAINTAINER
);
}
@JsonCreator
...
...
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