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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d7728599
Commit
d7728599
authored
Mar 12, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Web hook: controller refactoring
parent
29e8d02a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
37 deletions
+7
-37
app/controllers/groups/application_controller.rb
app/controllers/groups/application_controller.rb
+4
-0
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+0
-4
app/controllers/groups/hooks_controller.rb
app/controllers/groups/hooks_controller.rb
+1
-11
app/controllers/groups/ldap_group_links_controller.rb
app/controllers/groups/ldap_group_links_controller.rb
+1
-9
app/controllers/groups/ldaps_controller.rb
app/controllers/groups/ldaps_controller.rb
+1
-13
No files found.
app/controllers/groups/application_controller.rb
View file @
d7728599
...
...
@@ -7,4 +7,8 @@ class Groups::ApplicationController < ApplicationController
return
render_404
end
end
def
group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
end
app/controllers/groups/group_members_controller.rb
View file @
d7728599
...
...
@@ -71,10 +71,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
protected
def
group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
def
member_params
params
.
require
(
:group_member
).
permit
(
:access_level
,
:user_id
)
end
...
...
app/controllers/groups/hooks_controller.rb
View file @
d7728599
class
Groups::HooksController
<
ApplicationController
class
Groups::HooksController
<
Groups
::
ApplicationController
# Authorize
before_filter
:group
before_filter
:authorize_admin_group!
...
...
@@ -56,14 +56,4 @@ class Groups::HooksController < ApplicationController
def
hook_params
params
.
require
(
:hook
).
permit
(
:url
,
:push_events
,
:issues_events
,
:merge_requests_events
,
:tag_push_events
)
end
def
group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
def
authorize_admin_group!
unless
can?
(
current_user
,
:manage_group
,
group
)
return
render_404
end
end
end
app/controllers/groups/ldap_group_links_controller.rb
View file @
d7728599
class
Groups::LdapGroupLinksController
<
ApplicationController
class
Groups::LdapGroupLinksController
<
Groups
::
ApplicationController
before_action
:group
before_action
:require_ldap_enabled
before_action
:authorize_admin_group!
...
...
@@ -28,14 +28,6 @@ class Groups::LdapGroupLinksController < ApplicationController
private
def
group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
def
authorize_admin_group!
render_404
unless
can?
(
current_user
,
:manage_group
,
group
)
end
def
ldap_group_link_params
params
.
require
(
:ldap_group_link
).
permit
(
:cn
,
:group_access
,
:provider
)
end
...
...
app/controllers/groups/ldaps_controller.rb
View file @
d7728599
class
Groups::LdapsController
<
ApplicationController
class
Groups::LdapsController
<
Groups
::
ApplicationController
before_filter
:group
before_filter
:authorize_admin_group!
...
...
@@ -7,16 +7,4 @@ class Groups::LdapsController < ApplicationController
redirect_to
members_group_path
(
@group
),
notice:
'Access reset complete'
end
private
def
group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
def
authorize_admin_group!
unless
can?
(
current_user
,
:manage_group
,
group
)
return
render_404
end
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