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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
6a5a175d
Commit
6a5a175d
authored
Feb 04, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose allow_guest_to_access_builds in GitLab API
parent
5f7be11a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
doc/api/projects.md
doc/api/projects.md
+8
-2
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/projects.rb
lib/api/projects.rb
+9
-3
No files found.
doc/api/projects.md
View file @
6a5a175d
...
@@ -80,7 +80,9 @@ Parameters:
...
@@ -80,7 +80,9 @@ Parameters:
"avatar_url"
:
"http://example.com/uploads/project/avatar/4/uploads/avatar.png"
,
"avatar_url"
:
"http://example.com/uploads/project/avatar/4/uploads/avatar.png"
,
"shared_runners_enabled"
:
true
,
"shared_runners_enabled"
:
true
,
"forks_count"
:
0
,
"forks_count"
:
0
,
"star_count"
:
0
"star_count"
:
0
,
"runners_token"
:
"b8547b1dc37721d05889db52fa2f02"
,
"allow_guest_to_access_builds"
:
true
},
},
{
{
"id"
:
6
,
"id"
:
6
,
...
@@ -137,7 +139,8 @@ Parameters:
...
@@ -137,7 +139,8 @@ Parameters:
"shared_runners_enabled"
:
true
,
"shared_runners_enabled"
:
true
,
"forks_count"
:
0
,
"forks_count"
:
0
,
"star_count"
:
0
,
"star_count"
:
0
,
"runners_token"
:
"b8547b1dc37721d05889db52fa2f02"
"runners_token"
:
"b8547b1dc37721d05889db52fa2f02"
,
"allow_guest_to_access_builds"
:
true
}
}
]
]
```
```
...
@@ -424,6 +427,7 @@ Parameters:
...
@@ -424,6 +427,7 @@ Parameters:
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`visibility_level`
(optional)
-
`visibility_level`
(optional)
-
`import_url`
(optional)
-
`import_url`
(optional)
-
`allow_guest_to_access_builds`
(optional)
### Create project for user
### Create project for user
...
@@ -446,6 +450,7 @@ Parameters:
...
@@ -446,6 +450,7 @@ Parameters:
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`visibility_level`
(optional)
-
`visibility_level`
(optional)
-
`import_url`
(optional)
-
`import_url`
(optional)
-
`allow_guest_to_access_builds`
(optional)
### Edit project
### Edit project
...
@@ -469,6 +474,7 @@ Parameters:
...
@@ -469,6 +474,7 @@ Parameters:
-
`snippets_enabled`
(optional)
-
`snippets_enabled`
(optional)
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`visibility_level`
(optional)
-
`visibility_level`
(optional)
-
`allow_guest_to_access_builds`
(optional)
On success, method returns 200 with the updated project. If parameters are
On success, method returns 200 with the updated project. If parameters are
invalid, 400 is returned.
invalid, 400 is returned.
...
...
lib/api/entities.rb
View file @
6a5a175d
...
@@ -72,6 +72,7 @@ module API
...
@@ -72,6 +72,7 @@ module API
expose
:star_count
,
:forks_count
expose
:star_count
,
:forks_count
expose
:open_issues_count
,
if:
lambda
{
|
project
,
options
|
project
.
issues_enabled?
&&
project
.
default_issues_tracker?
}
expose
:open_issues_count
,
if:
lambda
{
|
project
,
options
|
project
.
issues_enabled?
&&
project
.
default_issues_tracker?
}
expose
:runners_token
,
if:
lambda
{
|
_project
,
options
|
options
[
:user_can_admin_project
]
}
expose
:runners_token
,
if:
lambda
{
|
_project
,
options
|
options
[
:user_can_admin_project
]
}
expose
:allow_guest_to_access_builds
end
end
class
ProjectMember
<
UserBasic
class
ProjectMember
<
UserBasic
...
...
lib/api/projects.rb
View file @
6a5a175d
...
@@ -99,6 +99,7 @@ module API
...
@@ -99,6 +99,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - 0 by default
# visibility_level (optional) - 0 by default
# import_url (optional)
# import_url (optional)
# allow_guest_to_access_builds (optional)
# Example Request
# Example Request
# POST /projects
# POST /projects
post
do
post
do
...
@@ -115,7 +116,8 @@ module API
...
@@ -115,7 +116,8 @@ module API
:namespace_id
,
:namespace_id
,
:public
,
:public
,
:visibility_level
,
:visibility_level
,
:import_url
]
:import_url
,
:allow_guest_to_access_builds
]
attrs
=
map_public_to_visibility_level
(
attrs
)
attrs
=
map_public_to_visibility_level
(
attrs
)
@project
=
::
Projects
::
CreateService
.
new
(
current_user
,
attrs
).
execute
@project
=
::
Projects
::
CreateService
.
new
(
current_user
,
attrs
).
execute
if
@project
.
saved?
if
@project
.
saved?
...
@@ -145,6 +147,7 @@ module API
...
@@ -145,6 +147,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional)
# visibility_level (optional)
# import_url (optional)
# import_url (optional)
# allow_guest_to_access_builds (optional)
# Example Request
# Example Request
# POST /projects/user/:user_id
# POST /projects/user/:user_id
post
"user/:user_id"
do
post
"user/:user_id"
do
...
@@ -161,7 +164,8 @@ module API
...
@@ -161,7 +164,8 @@ module API
:shared_runners_enabled
,
:shared_runners_enabled
,
:public
,
:public
,
:visibility_level
,
:visibility_level
,
:import_url
]
:import_url
,
:allow_guest_to_access_builds
]
attrs
=
map_public_to_visibility_level
(
attrs
)
attrs
=
map_public_to_visibility_level
(
attrs
)
@project
=
::
Projects
::
CreateService
.
new
(
user
,
attrs
).
execute
@project
=
::
Projects
::
CreateService
.
new
(
user
,
attrs
).
execute
if
@project
.
saved?
if
@project
.
saved?
...
@@ -205,6 +209,7 @@ module API
...
@@ -205,6 +209,7 @@ module API
# shared_runners_enabled (optional)
# shared_runners_enabled (optional)
# public (optional) - if true same as setting visibility_level = 20
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - visibility level of a project
# visibility_level (optional) - visibility level of a project
# allow_guest_to_access_builds (optional)
# Example Request
# Example Request
# PUT /projects/:id
# PUT /projects/:id
put
':id'
do
put
':id'
do
...
@@ -219,7 +224,8 @@ module API
...
@@ -219,7 +224,8 @@ module API
:snippets_enabled
,
:snippets_enabled
,
:shared_runners_enabled
,
:shared_runners_enabled
,
:public
,
:public
,
:visibility_level
]
:visibility_level
,
:allow_guest_to_access_builds
]
attrs
=
map_public_to_visibility_level
(
attrs
)
attrs
=
map_public_to_visibility_level
(
attrs
)
authorize_admin_project
authorize_admin_project
authorize!
:rename_project
,
user_project
if
attrs
[
:name
].
present?
authorize!
:rename_project
,
user_project
if
attrs
[
:name
].
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