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
00a3b466
Commit
00a3b466
authored
Jan 11, 2019
by
Fabian Schneider
Committed by
Dmitriy Zaporozhets
Jan 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix default visibility_level for new projects
parent
7a10ef6e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
app/models/project.rb
app/models/project.rb
+1
-1
changelogs/unreleased/45779-fix-default-visibility-level-for-projects.yml
...eased/45779-fix-default-visibility-level-for-projects.yml
+5
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+18
-0
No files found.
app/models/project.rb
View file @
00a3b466
...
@@ -73,7 +73,7 @@ class Project < ActiveRecord::Base
...
@@ -73,7 +73,7 @@ class Project < ActiveRecord::Base
delegate
:no_import?
,
to: :import_state
,
allow_nil:
true
delegate
:no_import?
,
to: :import_state
,
allow_nil:
true
default_value_for
:archived
,
false
default_value_for
:archived
,
false
default_value_for
:visibility_level
,
gitlab_config_features
.
visibility_level
default_value_for
(
:visibility_level
)
{
Gitlab
::
CurrentSettings
.
default_project_visibility
}
default_value_for
:resolve_outdated_diff_discussions
,
false
default_value_for
:resolve_outdated_diff_discussions
,
false
default_value_for
:container_registry_enabled
,
gitlab_config_features
.
container_registry
default_value_for
:container_registry_enabled
,
gitlab_config_features
.
container_registry
default_value_for
(
:repository_storage
)
{
Gitlab
::
CurrentSettings
.
pick_repository_storage
}
default_value_for
(
:repository_storage
)
{
Gitlab
::
CurrentSettings
.
pick_repository_storage
}
...
...
changelogs/unreleased/45779-fix-default-visibility-level-for-projects.yml
0 → 100644
View file @
00a3b466
---
title
:
Fix default visibility_level for new projects
merge_request
:
24120
author
:
Fabian Schneider @fabsrc
type
:
fixed
spec/models/project_spec.rb
View file @
00a3b466
...
@@ -1413,6 +1413,24 @@ describe Project do
...
@@ -1413,6 +1413,24 @@ describe Project do
end
end
end
end
describe
'#visibility_level'
do
let
(
:project
)
{
build
(
:project
)
}
subject
{
project
.
visibility_level
}
context
'by default'
do
it
{
is_expected
.
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
}
end
context
'when set to INTERNAL in application settings'
do
before
do
stub_application_setting
(
default_project_visibility:
Gitlab
::
VisibilityLevel
::
INTERNAL
)
end
it
{
is_expected
.
to
eq
(
Gitlab
::
VisibilityLevel
::
INTERNAL
)
}
end
end
describe
'#visibility_level_allowed?'
do
describe
'#visibility_level_allowed?'
do
let
(
:project
)
{
create
(
:project
,
:internal
)
}
let
(
:project
)
{
create
(
:project
,
:internal
)
}
...
...
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