2021-11-25 07:07:38 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-04 20:41:40 -04:00
|
|
|
class Api::V1::Admin::Trends::TagsController < Api::V1::Trends::TagsController
|
2022-01-17 03:41:33 -05:00
|
|
|
before_action -> { authorize_if_got_token! :'admin:read' }
|
2021-11-25 07:07:38 -05:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2022-07-04 20:41:40 -04:00
|
|
|
def enabled?
|
|
|
|
super || current_user&.can?(:manage_taxonomies)
|
|
|
|
end
|
|
|
|
|
|
|
|
def tags_from_trends
|
|
|
|
if current_user&.can?(:manage_taxonomies)
|
|
|
|
Trends.tags.query
|
|
|
|
else
|
|
|
|
super
|
|
|
|
end
|
2021-11-25 07:07:38 -05:00
|
|
|
end
|
|
|
|
end
|