Commit cf98a6d5 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Perform feature checks using method-missing in controller.

parent b68de6c7
......@@ -35,7 +35,7 @@ class Groups::ApplicationController < ApplicationController
def build_canonical_path(group)
params[:group_id] = group.to_param
url_for(params)
end
end
......@@ -2,7 +2,7 @@ class Groups::HooksController < Groups::ApplicationController
# Authorize
before_action :group
before_action :authorize_admin_group!
before_action :ensure_feature_available!
before_action :check_group_webhooks_available!
respond_to :html
......@@ -69,10 +69,4 @@ class Groups::HooksController < Groups::ApplicationController
:wiki_page_events
)
end
def ensure_feature_available!
unless @group.feature_available?(:group_webhooks)
render_404
end
end
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