2021-11-25 12:07:38 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-05 00:41:40 +00:00
|
|
|
class Api::V1::Admin::Trends::TagsController < Api::V1::Trends::TagsController
|
2022-01-17 08:41:33 +00:00
|
|
|
before_action -> { authorize_if_got_token! :'admin:read' }
|
2021-11-25 12:07:38 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2022-07-05 00:41:40 +00: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 12:07:38 +00:00
|
|
|
end
|
|
|
|
end
|