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
iv
gitlab-ce
Commits
d2846293
Commit
d2846293
authored
Nov 03, 2015
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move visibility_level check for forked projects to Project model
parent
77ef4855
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
app/helpers/visibility_level_helper.rb
app/helpers/visibility_level_helper.rb
+1
-2
app/models/project.rb
app/models/project.rb
+5
-0
No files found.
app/helpers/visibility_level_helper.rb
View file @
d2846293
...
...
@@ -89,7 +89,6 @@ module VisibilityLevelHelper
def
skip_level?
(
form_model
,
level
)
form_model
.
is_a?
(
Project
)
&&
form_model
.
forked?
&&
!
Gitlab
::
VisibilityLevel
.
allowed_fork_levels
(
form_model
.
forked_from_project
.
visibility_level
).
include?
(
level
)
!
form_model
.
visibility_level_allowed?
(
level
)
end
end
app/models/project.rb
View file @
d2846293
...
...
@@ -783,4 +783,9 @@ class Project < ActiveRecord::Base
service
.
active
=
true
service
.
save
end
def
visibility_level_allowed?
(
level
)
return
true
unless
forked?
Gitlab
::
VisibilityLevel
.
allowed_fork_levels
(
forked_from_project
.
visibility_level
).
include?
(
level
)
end
end
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