Files
akkounts/app/controllers/services/remotestorage_controller.rb
raucao 8fae099c12
CI / Test (pull_request) Successful in 2m4s
Release Drafter / Update release notes draft (pull_request) Successful in 2s
Gate remoteStorage by serviceEnabled instead of Flipper
The admin "Default services" setting writes the LDAP serviceEnabled
attribute, but remoteStorage access was also gated behind an unused
per-user Flipper flag that nothing ever enabled, so remoteStorage was
inaccessible for everyone.

Gate remoteStorage on service_enabled? like the other services, and make
the admin toggle reflect the LDAP attribute (this also fixes it reading
current_user instead of the user being viewed). E-Mail keeps its Flipper
gate for now.
2026-10-06 15:10:00 +02:00

26 lines
681 B
Ruby

class Services::RemotestorageController < Services::BaseController
before_action :authenticate_user!
before_action :require_service_available
before_action :require_service_enabled
# Dashboard
def show
# unless current_user.service_enabled?(:remotestorage)
# redirect_to service_remotestorage_info_path
# end
# @rs_apps_connected = current_user.remote_storage_authorizations.any?
end
private
def require_service_available
http_status :not_found unless Setting.remotestorage_enabled?
end
def require_service_enabled
unless current_user.service_enabled?(:remotestorage)
http_status :forbidden
end
end
end