24cb5da194
* 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>
13 lines
195 B
Ruby
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
|