diff options
author | Nick Thomas <nick@gitlab.com> | 2017-06-20 14:13:04 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-06-21 12:56:45 +0300 |
commit | 8e5bf9d8dc0cc7ef683eb9bebfe7fbde79db6cf1 (patch) | |
tree | 20fe2a7fd35d9d0b29e870dfdb626bc04bfc70c3 /app/controllers/projects/application_controller.rb | |
parent | 03228cb5b659ab6c9b631bafdf21ba77d6d2d2fa (diff) |
Use the new check_project_feature_available! method in project controllers
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r-- | app/controllers/projects/application_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index d085a566527..3d7ce4f0222 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -54,7 +54,12 @@ class Projects::ApplicationController < ApplicationController end def check_project_feature_available!(feature) - return render_404 unless project.feature_available?(feature, current_user) + render_404 unless project.feature_available?(feature, current_user) + end + + def check_issuables_available! + render_404 unless project.feature_available?(:issues, current_user) || + project.feature_available?(:merge_requests, current_user) end def method_missing(method_sym, *arguments, &block) |