diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-25 18:36:08 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-27 15:14:47 +0300 |
commit | 61b0e8ca0b2a1c50aeee318c7e42c40fd0816108 (patch) | |
tree | e8ee1bf5900919792526c04cf55e2b9647eb917b /app/controllers/instance_statistics | |
parent | fb6375a57633ba633760e5542739c544bf5595aa (diff) |
Spec instance statistics
Diffstat (limited to 'app/controllers/instance_statistics')
-rw-r--r-- | app/controllers/instance_statistics/application_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/instance_statistics/cohorts_controller.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/instance_statistics/application_controller.rb b/app/controllers/instance_statistics/application_controller.rb index d5bef4b4316..162e311f175 100644 --- a/app/controllers/instance_statistics/application_controller.rb +++ b/app/controllers/instance_statistics/application_controller.rb @@ -1,8 +1,8 @@ class InstanceStatistics::ApplicationController < ApplicationController - before_action :authenticate_user! + before_action :authorize_read_instance_statistics! layout 'instance_statistics' - def authenticate_user! + def authorize_read_instance_statistics! render_404 unless can?(current_user, :read_instance_statistics) end end diff --git a/app/controllers/instance_statistics/cohorts_controller.rb b/app/controllers/instance_statistics/cohorts_controller.rb index 77d09c198c8..7eba0a5ecdd 100644 --- a/app/controllers/instance_statistics/cohorts_controller.rb +++ b/app/controllers/instance_statistics/cohorts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class InstanceStatistics::CohortsController < InstanceStatistics::ApplicationController def index if Gitlab::CurrentSettings.usage_ping_enabled |