Project

General

Profile

« Previous | Next » 

Revision 82b4749e

Added by Marek Hulán about 10 years ago

Fixes #5664 - Host filters can use taxonomies

Also disables taxonomy filters on resources that do not support them.

View differences:

app/models/concerns/authorizable.rb
User.current.can?(permission, self)
end
end
module ClassMethods
def allows_taxonomy_filtering?(taxonomy)
scoped_search_definition.fields.has_key?(taxonomy)
end
def allows_organization_filtering?
allows_taxonomy_filtering?(:organization_id)
end
def allows_location_filtering?
allows_taxonomy_filtering?(:location_id)
end
end
end

Also available in: Unified diff