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
Jérome Perrin
gitlab-ce
Commits
37edce19
Commit
37edce19
authored
Aug 24, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recognize instances where group visibility levels are unavailable
parent
af6968a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/helpers/visibility_level_helper.rb
app/helpers/visibility_level_helper.rb
+2
-1
app/models/group.rb
app/models/group.rb
+6
-0
No files found.
app/helpers/visibility_level_helper.rb
View file @
37edce19
...
...
@@ -96,6 +96,7 @@ module VisibilityLevelHelper
to: :current_application_settings
def
skip_level?
(
form_model
,
level
)
form_model
.
is_a?
(
Project
)
&&
!
form_model
.
visibility_level_allowed?
(
level
)
return
false
unless
form_model
.
respond_to?
(
:visibility_level_allowed?
)
!
form_model
.
visibility_level_allowed?
(
level
)
end
end
app/models/group.rb
View file @
37edce19
...
...
@@ -136,6 +136,12 @@ class Group < Namespace
children
.
where
(
'visibility_level > ?'
,
level
).
none?
end
def
visibility_level_allowed?
(
level
=
self
.
visibility_level
)
visibility_level_allowed_by_parent?
(
level
)
&&
visibility_level_allowed_by_projects?
(
level
)
&&
visibility_level_allowed_by_sub_groups?
(
level
)
end
def
avatar_url
(
**
args
)
# We use avatar_path instead of overriding avatar_url because of carrierwave.
# See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11001/diffs#note_28659864
...
...
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