Commit 5146eaee authored by Robert Speicher's avatar Robert Speicher

Merge branch 'move-before_action-to-ldap_group_links_controller' into 'master'

Move before action method to ldap Groups::LdapGroupLinksController and removed some dead code

See merge request !838
parents f0e1b2d6 ba472090
......@@ -232,48 +232,6 @@ class ApplicationController < ActionController::Base
end
end
def require_ldap_enabled
unless Gitlab.config.ldap.enabled
render_404 and return
end
end
def set_filters_params
set_default_sort
params[:scope] = 'all' if params[:scope].blank?
params[:state] = 'opened' if params[:state].blank?
@sort = params[:sort]
@filter_params = params.dup
if @project
@filter_params[:project_id] = @project.id
elsif @group
@filter_params[:group_id] = @group.id
else
# TODO: this filter ignore issues/mr created in public or
# internal repos where you are not a member. Enable this filter
# or improve current implementation to filter only issues you
# created or assigned or mentioned
# @filter_params[:authorized_only] = true
end
@filter_params
end
def get_issues_collection
set_filters_params
@issuable_finder = IssuesFinder.new(current_user, @filter_params)
@issuable_finder.execute
end
def get_merge_requests_collection
set_filters_params
@issuable_finder = MergeRequestsFinder.new(current_user, @filter_params)
@issuable_finder.execute
end
def import_sources_enabled?
!current_application_settings.import_sources.empty?
end
......
......@@ -31,6 +31,12 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
private
def require_ldap_enabled
unless Gitlab.config.ldap.enabled
render_404 and return
end
end
def ldap_group_link_params
params.require(:ldap_group_link).permit(:cn, :group_access, :provider)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment