Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-26 13:05:18 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-04-30 12:40:51 +0300
commit0f593b1c579c272f681696b96a8fc6aa32342ae6 (patch)
treee208c60558ff3cefc75a8551a3d3804379344162 /lib/gitlab/base_doorkeeper_controller.rb
parent507e3fbca30441983322c37408988b6a49f0acc5 (diff)
Define custom base controller for Doorkeeper
Since we only need the `can?` view helpers there, it's better to include those in a separate controller. If we inherit from `ApplicationController` we also need to deal with authentication, that needs to be done in some, but not all doorkeeper controllers.
Diffstat (limited to 'lib/gitlab/base_doorkeeper_controller.rb')
-rw-r--r--lib/gitlab/base_doorkeeper_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/base_doorkeeper_controller.rb b/lib/gitlab/base_doorkeeper_controller.rb
new file mode 100644
index 00000000000..e4227af25d2
--- /dev/null
+++ b/lib/gitlab/base_doorkeeper_controller.rb
@@ -0,0 +1,8 @@
+# This is a base controller for doorkeeper.
+# It adds the `can?` helper used in the views.
+module Gitlab
+ class BaseDoorkeeperController < ActionController::Base
+ include Gitlab::Allowable
+ helper_method :can?
+ end
+end