BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
627909c2
Commit
627909c2
authored
Feb 02, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CI setting: allow_guest_to_access_builds
Add the `read_build` ability if user is anonymous or guest and allow_guest_to_access_builds is enabled.
parent
055afab5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
25 deletions
+47
-25
projects_controller.rb
app/controllers/projects_controller.rb
+1
-0
ability.rb
app/models/ability.rb
+8
-6
edit.html.haml
app/views/projects/edit.html.haml
+6
-2
20160202164642_add_allow_guest_to_access_builds_project.rb
...0160202164642_add_allow_guest_to_access_builds_project.rb
+5
-0
schema.rb
db/schema.rb
+18
-17
permissions.md
doc/permissions/permissions.md
+9
-0
No files found.
app/controllers/projects_controller.rb
View file @
627909c2
...
@@ -227,6 +227,7 @@ class ProjectsController < ApplicationController
...
@@ -227,6 +227,7 @@ class ProjectsController < ApplicationController
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:default_branch
,
:issues_enabled
,
:merge_requests_enabled
,
:snippets_enabled
,
:issues_tracker_id
,
:default_branch
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
,
:avatar
,
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
,
:avatar
,
:builds_enabled
,
:build_allow_git_fetch
,
:build_timeout_in_minutes
,
:build_coverage_regex
,
:builds_enabled
,
:build_allow_git_fetch
,
:build_timeout_in_minutes
,
:build_coverage_regex
,
:allow_guest_to_access_builds
,
)
)
end
end
...
...
app/models/ability.rb
View file @
627909c2
...
@@ -53,12 +53,11 @@ class Ability
...
@@ -53,12 +53,11 @@ class Ability
:read_merge_request
,
:read_merge_request
,
:read_note
,
:read_note
,
:read_commit_status
,
:read_commit_status
,
:read_build
,
:download_code
:download_code
]
]
if
project
.
restrict
_builds?
if
project
.
allow_guest_to_access
_builds?
rules
-
=
:read_build
rules
+
=
:read_build
end
end
rules
-
project_disabled_features_rules
(
project
)
rules
-
project_disabled_features_rules
(
project
)
...
@@ -114,13 +113,17 @@ class Ability
...
@@ -114,13 +113,17 @@ class Ability
elsif
team
.
guest?
(
user
)
elsif
team
.
guest?
(
user
)
rules
.
push
(
*
project_guest_rules
)
rules
.
push
(
*
project_guest_rules
)
if
project
.
allow_guest_to_access_builds?
rules
+=
:read_build
end
end
end
if
project
.
public?
||
project
.
internal?
if
project
.
public?
||
project
.
internal?
rules
.
push
(
*
public_project_rules
)
rules
.
push
(
*
public_project_rules
)
if
team
.
guest?
(
user
)
&&
project
.
restrict
_builds?
if
project
.
allow_guest_to_access
_builds?
rules
-=
named_abilities
(
'build'
)
rules
+=
:read_build
end
end
end
end
...
@@ -145,7 +148,6 @@ class Ability
...
@@ -145,7 +148,6 @@ class Ability
:download_code
,
:download_code
,
:fork_project
,
:fork_project
,
:read_commit_status
,
:read_commit_status
,
:read_build
,
]
]
end
end
...
...
app/views/projects/edit.html.haml
View file @
627909c2
...
@@ -157,8 +157,12 @@
...
@@ -157,8 +157,12 @@
%li
%li
phpunit --coverage-text --colors=never (PHP) -
phpunit --coverage-text --colors=never (PHP) -
%code
^\s*Lines:\s*\d+.\d+\%
%code
^\s*Lines:\s*\d+.\d+\%
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
=
f
.
label
:allow_guest_to_access_builds
do
=
f
.
check_box
:allow_guest_to_access_builds
Allow guest to access builds (including build logs and artifacts)
%fieldset
.features
%fieldset
.features
%legend
%legend
Advanced settings
Advanced settings
...
...
db/migrate/20160202164642_add_allow_guest_to_access_builds_project.rb
0 → 100644
View file @
627909c2
class
AddAllowGuestToAccessBuildsProject
<
ActiveRecord
::
Migration
def
change
add_column
:projects
,
:allow_guest_to_access_builds
,
:boolean
,
default:
true
,
null:
false
end
end
db/schema.rb
View file @
627909c2
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20160
128233227
)
do
ActiveRecord
::
Schema
.
define
(
version:
20160
202164642
)
do
# These are extensions that must be enabled in order to support this database
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
enable_extension
"plpgsql"
...
@@ -650,34 +650,35 @@ ActiveRecord::Schema.define(version: 20160128233227) do
...
@@ -650,34 +650,35 @@ ActiveRecord::Schema.define(version: 20160128233227) do
t
.
datetime
"created_at"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"updated_at"
t
.
integer
"creator_id"
t
.
integer
"creator_id"
t
.
boolean
"issues_enabled"
,
default:
true
,
null:
false
t
.
boolean
"issues_enabled"
,
default:
true
,
null:
false
t
.
boolean
"wall_enabled"
,
default:
true
,
null:
false
t
.
boolean
"wall_enabled"
,
default:
true
,
null:
false
t
.
boolean
"merge_requests_enabled"
,
default:
true
,
null:
false
t
.
boolean
"merge_requests_enabled"
,
default:
true
,
null:
false
t
.
boolean
"wiki_enabled"
,
default:
true
,
null:
false
t
.
boolean
"wiki_enabled"
,
default:
true
,
null:
false
t
.
integer
"namespace_id"
t
.
integer
"namespace_id"
t
.
string
"issues_tracker"
,
default:
"gitlab"
,
null:
false
t
.
string
"issues_tracker"
,
default:
"gitlab"
,
null:
false
t
.
string
"issues_tracker_id"
t
.
string
"issues_tracker_id"
t
.
boolean
"snippets_enabled"
,
default:
true
,
null:
false
t
.
boolean
"snippets_enabled"
,
default:
true
,
null:
false
t
.
datetime
"last_activity_at"
t
.
datetime
"last_activity_at"
t
.
string
"import_url"
t
.
string
"import_url"
t
.
integer
"visibility_level"
,
default:
0
,
null:
false
t
.
integer
"visibility_level"
,
default:
0
,
null:
false
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
string
"avatar"
t
.
string
"avatar"
t
.
string
"import_status"
t
.
string
"import_status"
t
.
float
"repository_size"
,
default:
0.0
t
.
float
"repository_size"
,
default:
0.0
t
.
integer
"star_count"
,
default:
0
,
null:
false
t
.
integer
"star_count"
,
default:
0
,
null:
false
t
.
string
"import_type"
t
.
string
"import_type"
t
.
string
"import_source"
t
.
string
"import_source"
t
.
integer
"commit_count"
,
default:
0
t
.
integer
"commit_count"
,
default:
0
t
.
text
"import_error"
t
.
text
"import_error"
t
.
integer
"ci_id"
t
.
integer
"ci_id"
t
.
boolean
"builds_enabled"
,
default:
true
,
null:
false
t
.
boolean
"builds_enabled"
,
default:
true
,
null:
false
t
.
boolean
"shared_runners_enabled"
,
default:
true
,
null:
false
t
.
boolean
"shared_runners_enabled"
,
default:
true
,
null:
false
t
.
string
"runners_token"
t
.
string
"runners_token"
t
.
string
"build_coverage_regex"
t
.
string
"build_coverage_regex"
t
.
boolean
"build_allow_git_fetch"
,
default:
true
,
null:
false
t
.
boolean
"build_allow_git_fetch"
,
default:
true
,
null:
false
t
.
integer
"build_timeout"
,
default:
3600
,
null:
false
t
.
integer
"build_timeout"
,
default:
3600
,
null:
false
t
.
boolean
"pending_delete"
,
default:
false
t
.
boolean
"pending_delete"
,
default:
false
t
.
boolean
"allow_guest_to_access_builds"
,
default:
true
,
null:
false
end
end
add_index
"projects"
,
[
"builds_enabled"
,
"shared_runners_enabled"
],
name:
"index_projects_on_builds_enabled_and_shared_runners_enabled"
,
using: :btree
add_index
"projects"
,
[
"builds_enabled"
,
"shared_runners_enabled"
],
name:
"index_projects_on_builds_enabled_and_shared_runners_enabled"
,
using: :btree
...
...
doc/permissions/permissions.md
View file @
627909c2
...
@@ -18,6 +18,9 @@ documentation](../workflow/add-user/add-user.md).
...
@@ -18,6 +18,9 @@ documentation](../workflow/add-user/add-user.md).
|---------------------------------------|---------|------------|-------------|----------|--------|
|---------------------------------------|---------|------------|-------------|----------|--------|
| Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ |
| Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ |
| See a list of builds | ✓
[
^1
]
| ✓ | ✓ | ✓ | ✓ |
| See a build log | ✓
[
^1
]
| ✓ | ✓ | ✓ | ✓ |
| Download and browse build artifacts | ✓
[
^1
]
| ✓ | ✓ | ✓ | ✓ |
| Pull project code | | ✓ | ✓ | ✓ | ✓ |
| Pull project code | | ✓ | ✓ | ✓ | ✓ |
| Download project | | ✓ | ✓ | ✓ | ✓ |
| Download project | | ✓ | ✓ | ✓ | ✓ |
| Create code snippets | | ✓ | ✓ | ✓ | ✓ |
| Create code snippets | | ✓ | ✓ | ✓ | ✓ |
...
@@ -31,6 +34,7 @@ documentation](../workflow/add-user/add-user.md).
...
@@ -31,6 +34,7 @@ documentation](../workflow/add-user/add-user.md).
| Remove non-protected branches | | | ✓ | ✓ | ✓ |
| Remove non-protected branches | | | ✓ | ✓ | ✓ |
| Add tags | | | ✓ | ✓ | ✓ |
| Add tags | | | ✓ | ✓ | ✓ |
| Write a wiki | | | ✓ | ✓ | ✓ |
| Write a wiki | | | ✓ | ✓ | ✓ |
| Cancel and retry builds | | | ✓ | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ |
...
@@ -40,12 +44,17 @@ documentation](../workflow/add-user/add-user.md).
...
@@ -40,12 +44,17 @@ documentation](../workflow/add-user/add-user.md).
| Edit project | | | | ✓ | ✓ |
| Edit project | | | | ✓ | ✓ |
| Add deploy keys to project | | | | ✓ | ✓ |
| Add deploy keys to project | | | | ✓ | ✓ |
| Configure project hooks | | | | ✓ | ✓ |
| Configure project hooks | | | | ✓ | ✓ |
| Manage runners | | | | ✓ | ✓ |
| Manage build triggers | | | | ✓ | ✓ |
| Manage variables | | | | ✓ | ✓ |
| Switch visibility level | | | | | ✓ |
| Switch visibility level | | | | | ✓ |
| Transfer project to another namespace | | | | | ✓ |
| Transfer project to another namespace | | | | | ✓ |
| Remove project | | | | | ✓ |
| Remove project | | | | | ✓ |
| Force push to protected branches | | | | | |
| Force push to protected branches | | | | | |
| Remove protected branches | | | | | |
| Remove protected branches | | | | | |
[
^1
]:
If
**Allow guest to access builds**
is enabled in CI settings
## Group
## Group
In order for a group to appear as public and be browsable, it must contain at
In order for a group to appear as public and be browsable, it must contain at
...
...
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