1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-12-24 19:48:22 +09:00
whippy-edition/app/controllers/api/v1/admin/trends/links_controller.rb

20 lines
393 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Api::V1::Admin::Trends::LinksController < Api::V1::Trends::LinksController
before_action -> { authorize_if_got_token! :'admin:read' }
private
def enabled?
super || current_user&.can?(:manage_taxonomies)
end
def links_from_trends
if current_user&.can?(:manage_taxonomies)
Trends.links.query
else
super
end
end
end