hackatime/app/controllers/settings/admin_controller.rb
Mahad Kalam 42ceec73cb
Upgrade Inertia + new settings page (#950)
* New settings?

* New Settings page!

* Vendor Inertia

* Fix some issues

* <Link>ify the site!
2026-02-15 17:32:26 +00:00

18 lines
462 B
Ruby

class Settings::AdminController < Settings::BaseController
before_action :require_admin_section_access
def show
render_settings_page(
active_section: "admin",
settings_update_path: my_settings_profile_path
)
end
private
def require_admin_section_access
unless current_user.admin_level.in?(%w[admin superadmin])
redirect_to my_settings_profile_path, alert: "You are not authorized to access this page"
end
end
end