Sha256: 3983d94c33c59607f16057927f359058b2b9ae734e4cea521ce86c7672c6ef69
Contents?: true
Size: 1.09 KB
Versions: 22
Compression:
Stored size: 1.09 KB
Contents
module Katello module Authorization::System extend ActiveSupport::Concern include Authorizable def readable? authorized?(:view_content_hosts) end def editable? authorized?(:edit_content_hosts) end def deletable? authorized?(:destroy_content_hosts) end module ClassMethods def readable_search_filters(_org) {:or => [ {:terms => {:environment_id => KTEnvironment.readable.pluck(:id) }} ] } end def readable authorized(:view_content_hosts) end def readable? User.current.can?(:view_content_hosts) end def editable authorized(:edit_content_hosts) end def deletable authorized(:destroy_content_hosts) end def any_editable? authorized(:edit_content_hosts).count > 0 end def all_editable?(content_view, environments) systems_query = System.where(:content_view_id => content_view, :environment_id => environments) systems_query.count == systems_query.editable.count end end end end
Version data entries
22 entries across 22 versions & 1 rubygems