Commit 03228cb5 authored by Nick Thomas's avatar Nick Thomas

Backport check_project_feature_available! from EE

parent 4b0b2f15
......@@ -53,9 +53,16 @@ class Projects::ApplicationController < ApplicationController
end
end
def check_project_feature_available!(feature)
return render_404 unless project.feature_available?(feature, current_user)
end
def method_missing(method_sym, *arguments, &block)
if method_sym.to_s =~ /\Aauthorize_(.*)!\z/
case method_sym.to_s
when /\Aauthorize_(.*)!\z/
authorize_action!($1.to_sym)
when /\Acheck_(.*)_available!\z/
check_project_feature_available!($1.to_sym)
else
super
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