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
3fe7f31a
Commit
3fe7f31a
authored
Oct 10, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `GroupFinder` to check if a user can read a group
parent
deb45634
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+4
-2
No files found.
app/controllers/groups_controller.rb
View file @
3fe7f31a
...
@@ -60,12 +60,14 @@ class GroupsController < Groups::ApplicationController
...
@@ -60,12 +60,14 @@ class GroupsController < Groups::ApplicationController
def
children
def
children
parent
=
if
params
[
:parent_id
].
present?
parent
=
if
params
[
:parent_id
].
present?
Group
.
find
(
params
[
:parent_id
])
Group
Finder
.
new
(
current_user
).
execute
(
id:
params
[
:parent_id
])
else
else
@group
@group
end
end
if
parent
.
nil?
||
!
can?
(
current_user
,
:read_group
,
parent
)
if
parent
.
nil?
render_404
render_404
return
end
end
setup_children
(
parent
)
setup_children
(
parent
)
...
...
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