Sha256: 15168e5f03c9c3ca14c6fc0e9e8f476ab2a3c4eda71dddae5da313fa5f63e9b1

Contents?: true

Size: 818 Bytes

Versions: 31

Compression:

Stored size: 818 Bytes

Contents

module Katello
  module Authorization::ContentViewVersion
    extend ActiveSupport::Concern

    def all_hosts_editable?(lifecycle_environment)
      total_hosts = ::Host.in_content_view_environment(:content_view => self.content_view, :lifecycle_environment => lifecycle_environment)
      authorized_hosts = ::Host.authorized("view_hosts").in_content_view_environment(:content_view => self.content_view,
                                                                                     :lifecycle_environment => lifecycle_environment)
      total_hosts.count == authorized_hosts.count
    end

    module ClassMethods
      def readable
        view_ids = ContentView.readable.collect { |v| v.id }
        joins(:content_view).where("#{Katello::ContentView.table_name}.id" => view_ids)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
katello-3.5.2 app/models/katello/authorization/content_view_version.rb
katello-3.5.1.1 app/models/katello/authorization/content_view_version.rb
katello-3.5.1 app/models/katello/authorization/content_view_version.rb
katello-3.5.0.1 app/models/katello/authorization/content_view_version.rb
katello-3.5.0 app/models/katello/authorization/content_view_version.rb
katello-3.5.0.rc2 app/models/katello/authorization/content_view_version.rb
katello-3.5.0.rc1 app/models/katello/authorization/content_view_version.rb
katello-3.4.5 app/models/katello/authorization/content_view_version.rb
katello-3.4.4 app/models/katello/authorization/content_view_version.rb
katello-3.4.2 app/models/katello/authorization/content_view_version.rb
katello-3.4.1 app/models/katello/authorization/content_view_version.rb
katello-3.4.0.2 app/models/katello/authorization/content_view_version.rb
katello-3.4.0.1 app/models/katello/authorization/content_view_version.rb
katello-3.3.2 app/models/katello/authorization/content_view_version.rb
katello-3.4.0 app/models/katello/authorization/content_view_version.rb
katello-3.4.0.rc2 app/models/katello/authorization/content_view_version.rb
katello-3.4.0.rc1 app/models/katello/authorization/content_view_version.rb
katello-3.3.1.1 app/models/katello/authorization/content_view_version.rb
katello-3.3.1 app/models/katello/authorization/content_view_version.rb
katello-3.3.0.1 app/models/katello/authorization/content_view_version.rb