Use filter instance method `available?` for checking Enterprise Token

pull/6038/head
Wieland Lindenthal 7 years ago
parent 643e945b85
commit 09988ec233
  1. 6
      app/models/queries/work_packages.rb
  2. 5
      app/models/queries/work_packages/filter/attachment_base_filter.rb

@ -34,10 +34,8 @@ module Queries::WorkPackages
register.filter Query, filters_module::AssignedToFilter
register.filter Query, filters_module::AssigneeOrGroupFilter
if EnterpriseToken.allows_to?(:attachment_filters)
register.filter Query, filters_module::AttachmentContentFilter
register.filter Query, filters_module::AttachmentFileNameFilter
end
register.filter Query, filters_module::AttachmentContentFilter
register.filter Query, filters_module::AttachmentFileNameFilter
register.filter Query, filters_module::AuthorFilter
register.filter Query, filters_module::CategoryFilter
register.filter Query, filters_module::CreatedAtFilter

@ -36,6 +36,11 @@ class Queries::WorkPackages::Filter::AttachmentBaseFilter < Queries::WorkPackage
:attachments
end
def available?
EnterpriseToken.allows_to?(:attachment_filters)
end
def search_column
raise NotImplementedError
end

Loading…
Cancel
Save