Add base controller for service controllers
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
Râu Cao 2023-08-07 18:15:17 +02:00
parent 852e2fea1e
commit f49aff262c
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
2 changed files with 14 additions and 12 deletions

View File

@ -0,0 +1,9 @@
class Services::BaseController < ApplicationController
before_action :set_current_section
private
def set_current_section
@current_section = :services
end
end

View File

@ -1,8 +1,7 @@
class Services::RemotestorageController < ApplicationController
before_action :require_user_signed_in
before_action :require_service_enabled
class Services::RemotestorageController < Services::BaseController
before_action :authenticate_user!
before_action :require_feature_enabled
before_action :set_current_section
before_action :require_service_available
def dashboard
# unless current_user.services_enabled.include?(:remotestorage)
@ -18,13 +17,7 @@ class Services::RemotestorageController < ApplicationController
end
end
def require_service_enabled
unless Setting.remotestorage_enabled?
http_status :not_found
end
end
def set_current_section
@current_section = :services
def require_service_available
http_status :not_found unless Setting.remotestorage_enabled?
end
end