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

pull/6038/head
Wieland Lindenthal 7 years ago
parent 643e945b85
commit 09988ec233
  1. 2
      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::AssignedToFilter
register.filter Query, filters_module::AssigneeOrGroupFilter register.filter Query, filters_module::AssigneeOrGroupFilter
if EnterpriseToken.allows_to?(:attachment_filters)
register.filter Query, filters_module::AttachmentContentFilter register.filter Query, filters_module::AttachmentContentFilter
register.filter Query, filters_module::AttachmentFileNameFilter register.filter Query, filters_module::AttachmentFileNameFilter
end
register.filter Query, filters_module::AuthorFilter register.filter Query, filters_module::AuthorFilter
register.filter Query, filters_module::CategoryFilter register.filter Query, filters_module::CategoryFilter
register.filter Query, filters_module::CreatedAtFilter register.filter Query, filters_module::CreatedAtFilter

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

Loading…
Cancel
Save