Commit f5d3e47e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Hide ldap group links if ldap is not enabled

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 230900b9
...@@ -239,4 +239,10 @@ class ApplicationController < ActionController::Base ...@@ -239,4 +239,10 @@ class ApplicationController < ActionController::Base
redirect_to profile_path, notice: 'Please complete your profile with email address' and return redirect_to profile_path, notice: 'Please complete your profile with email address' and return
end end
end end
def require_ldap_enabled
unless Gitlab.config.ldap.enabled
render_404 and return
end
end
end end
class Groups::LdapGroupLinksController < ApplicationController class Groups::LdapGroupLinksController < ApplicationController
before_action :group before_action :group
before_action :require_ldap_enabled
before_action :authorize_admin_group! before_action :authorize_admin_group!
layout 'group' layout 'group'
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
= link_to projects_group_path(@group) do = link_to projects_group_path(@group) do
%i.fa.fa-folder %i.fa.fa-folder
Projects Projects
= nav_link(controller: :ldap_group_links) do - if ldap_enabled?
= link_to group_ldap_group_links_path(@group) do = nav_link(controller: :ldap_group_links) do
%i.icon-exchange = link_to group_ldap_group_links_path(@group) do
LDAP Groups %i.fa.fa-exchange
LDAP Groups
= nav_link(controller: :audit_events) do = nav_link(controller: :audit_events) do
= link_to group_audit_events_path(@group) do = link_to group_audit_events_path(@group) do
%i.fa.fa-file-text-o %i.fa.fa-file-text-o
......
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