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
Hide 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:
"avatar_url"
:
"http://example.com/uploads/project/avatar/4/uploads/avatar.png"
,
"shared_runners_enabled"
:
true
,
"forks_count"
:
0
,
"star_count"
:
0
"star_count"
:
0
,
"runners_token"
:
"b8547b1dc37721d05889db52fa2f02"
,
"allow_guest_to_access_builds"
:
true
},
{
"id"
:
6
,
...
...
@@ -137,7 +139,8 @@ Parameters:
"shared_runners_enabled"
:
true
,
"forks_count"
:
0
,
"star_count"
:
0
,
"runners_token"
:
"b8547b1dc37721d05889db52fa2f02"
"runners_token"
:
"b8547b1dc37721d05889db52fa2f02"
,
"allow_guest_to_access_builds"
:
true
}
]
```
...
...
@@ -424,6 +427,7 @@ Parameters:
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`visibility_level`
(optional)
-
`import_url`
(optional)
-
`allow_guest_to_access_builds`
(optional)
### Create project for user
...
...
@@ -446,6 +450,7 @@ Parameters:
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`visibility_level`
(optional)
-
`import_url`
(optional)
-
`allow_guest_to_access_builds`
(optional)
### Edit project
...
...
@@ -469,6 +474,7 @@ Parameters:
-
`snippets_enabled`
(optional)
-
`public`
(optional) - if
`true`
same as setting visibility_level = 20
-
`visibility_level`
(optional)
-
`allow_guest_to_access_builds`
(optional)
On success, method returns 200 with the updated project. If parameters are
invalid, 400 is returned.
...
...
lib/api/entities.rb
View file @
6a5a175d
...
...
@@ -72,6 +72,7 @@ module API
expose
:star_count
,
:forks_count
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
:allow_guest_to_access_builds
end
class
ProjectMember
<
UserBasic
...
...
lib/api/projects.rb
View file @
6a5a175d
...
...
@@ -99,6 +99,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - 0 by default
# import_url (optional)
# allow_guest_to_access_builds (optional)
# Example Request
# POST /projects
post
do
...
...
@@ -115,7 +116,8 @@ module API
:namespace_id
,
:public
,
:visibility_level
,
:import_url
]
:import_url
,
:allow_guest_to_access_builds
]
attrs
=
map_public_to_visibility_level
(
attrs
)
@project
=
::
Projects
::
CreateService
.
new
(
current_user
,
attrs
).
execute
if
@project
.
saved?
...
...
@@ -145,6 +147,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional)
# import_url (optional)
# allow_guest_to_access_builds (optional)
# Example Request
# POST /projects/user/:user_id
post
"user/:user_id"
do
...
...
@@ -161,7 +164,8 @@ module API
:shared_runners_enabled
,
:public
,
:visibility_level
,
:import_url
]
:import_url
,
:allow_guest_to_access_builds
]
attrs
=
map_public_to_visibility_level
(
attrs
)
@project
=
::
Projects
::
CreateService
.
new
(
user
,
attrs
).
execute
if
@project
.
saved?
...
...
@@ -205,6 +209,7 @@ module API
# shared_runners_enabled (optional)
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - visibility level of a project
# allow_guest_to_access_builds (optional)
# Example Request
# PUT /projects/:id
put
':id'
do
...
...
@@ -219,7 +224,8 @@ module API
:snippets_enabled
,
:shared_runners_enabled
,
:public
,
:visibility_level
]
:visibility_level
,
:allow_guest_to_access_builds
]
attrs
=
map_public_to_visibility_level
(
attrs
)
authorize_admin_project
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