Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2f06369a
Commit
2f06369a
authored
Jan 30, 2020
by
Alex Pooley
Committed by
Kamil Trzciński
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Add can_create_merge_request_in to Project API response"
parent
b88f2bec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
0 deletions
+23
-0
changelogs/unreleased/198464-add-can_create_merge_request_in-to-project-api-response.yml
...d-can_create_merge_request_in-to-project-api-response.yml
+5
-0
doc/api/projects.md
doc/api/projects.md
+12
-0
lib/api/entities.rb
lib/api/entities.rb
+4
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+2
-0
No files found.
changelogs/unreleased/198464-add-can_create_merge_request_in-to-project-api-response.yml
0 → 100644
View file @
2f06369a
---
title
:
Add can_create_merge_request_in to /project/:id API response
merge_request
:
23577
author
:
type
:
added
doc/api/projects.md
View file @
2f06369a
...
...
@@ -129,6 +129,7 @@ When the user is authenticated and `simple` is not set this returns something li
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -205,6 +206,7 @@ When the user is authenticated and `simple` is not set this returns something li
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -371,6 +373,7 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -447,6 +450,7 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -584,6 +588,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -657,6 +662,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -774,6 +780,7 @@ GET /projects/:id
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"container_expiration_policy"
:
{
...
...
@@ -1260,6 +1267,7 @@ Example responses:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -1342,6 +1350,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -1431,6 +1440,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -1594,6 +1604,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
@@ -1702,6 +1713,7 @@ Example response:
"jobs_enabled"
:
true
,
"wiki_enabled"
:
true
,
"snippets_enabled"
:
false
,
"can_create_merge_request_in"
:
true
,
"resolve_outdated_diff_discussions"
:
false
,
"container_registry_enabled"
:
false
,
"created_at"
:
"2013-09-30T13:46:02Z"
,
...
...
lib/api/entities.rb
View file @
2f06369a
...
...
@@ -132,6 +132,10 @@ module API
expose
(
:jobs_enabled
)
{
|
project
,
options
|
project
.
feature_available?
(
:builds
,
options
[
:current_user
])
}
expose
(
:snippets_enabled
)
{
|
project
,
options
|
project
.
feature_available?
(
:snippets
,
options
[
:current_user
])
}
expose
(
:can_create_merge_request_in
)
do
|
project
,
options
|
Ability
.
allowed?
(
options
[
:current_user
],
:create_merge_request_in
,
project
)
end
expose
(
:issues_access_level
)
{
|
project
,
options
|
project
.
project_feature
.
string_access_level
(
:issues
)
}
expose
(
:repository_access_level
)
{
|
project
,
options
|
project
.
project_feature
.
string_access_level
(
:repository
)
}
expose
(
:merge_requests_access_level
)
{
|
project
,
options
|
project
.
project_feature
.
string_access_level
(
:merge_requests
)
}
...
...
spec/requests/api/projects_spec.rb
View file @
2f06369a
...
...
@@ -1340,6 +1340,7 @@ describe API::Projects do
expect
(
json_response
[
'path'
]).
to
be_present
expect
(
json_response
[
'issues_enabled'
]).
to
be_present
expect
(
json_response
[
'merge_requests_enabled'
]).
to
be_present
expect
(
json_response
[
'can_create_merge_request_in'
]).
to
be_present
expect
(
json_response
[
'wiki_enabled'
]).
to
be_present
expect
(
json_response
[
'jobs_enabled'
]).
to
be_present
expect
(
json_response
[
'snippets_enabled'
]).
to
be_present
...
...
@@ -1390,6 +1391,7 @@ describe API::Projects do
expect
(
json_response
[
'path'
]).
to
be_present
expect
(
json_response
[
'issues_enabled'
]).
to
be_present
expect
(
json_response
[
'merge_requests_enabled'
]).
to
be_present
expect
(
json_response
[
'can_create_merge_request_in'
]).
to
be_present
expect
(
json_response
[
'wiki_enabled'
]).
to
be_present
expect
(
json_response
[
'jobs_enabled'
]).
to
be_present
expect
(
json_response
[
'snippets_enabled'
]).
to
be_present
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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