Files
fizzy/app/controllers/concerns/staff_only.rb
T
Stanko Krtalić 24cb5da194 Make Fizzy Ask staff-only (#1037)
* Make Fizzy Ask invisible but usable by staff

* Remove unused span

* Prevent non-staff users from creating or browsing messages

* Extract staff-only into a mixin

* Keep existing markup, use the utility class we already have

---------

Co-authored-by: Jason Zimdars <jz@37signals.com>
2025-09-09 11:23:31 +02:00

13 lines
195 B
Ruby

module StaffOnly
extend ActiveSupport::Concern
included do
before_action :ensure_staff
end
private
def ensure_staff
head :forbidden unless Current.user.staff?
end
end