Sha256: 6e58cc3ee2fa7e3c80d55e9ae997f96c56821f984c18f954713ddd1f31a6faa1

Contents?: true

Size: 829 Bytes

Versions: 85

Compression:

Stored size: 829 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 = ::Katello::ContentView.readable.collect { |v| v.id }
        joins(:content_view).where("#{Katello::ContentView.table_name}.id" => view_ids)
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
katello-3.17.3 app/models/katello/authorization/content_view_version.rb
katello-3.17.2 app/models/katello/authorization/content_view_version.rb
katello-3.17.1 app/models/katello/authorization/content_view_version.rb
katello-3.16.2 app/models/katello/authorization/content_view_version.rb
katello-3.18.0.rc2.1 app/models/katello/authorization/content_view_version.rb
katello-3.18.0.rc2 app/models/katello/authorization/content_view_version.rb
katello-3.17.0 app/models/katello/authorization/content_view_version.rb
katello-3.18.0.rc1 app/models/katello/authorization/content_view_version.rb
katello-3.17.0.rc2.2 app/models/katello/authorization/content_view_version.rb
katello-3.17.0.rc2.1 app/models/katello/authorization/content_view_version.rb
katello-3.16.1.2 app/models/katello/authorization/content_view_version.rb
katello-3.16.1.1 app/models/katello/authorization/content_view_version.rb
katello-3.17.0.rc2 app/models/katello/authorization/content_view_version.rb
katello-3.16.1 app/models/katello/authorization/content_view_version.rb
katello-3.17.0.rc1 app/models/katello/authorization/content_view_version.rb
katello-3.16.0 app/models/katello/authorization/content_view_version.rb
katello-3.16.0.rc5.1 app/models/katello/authorization/content_view_version.rb
katello-3.16.0.rc5 app/models/katello/authorization/content_view_version.rb
katello-3.16.0.rc4.1 app/models/katello/authorization/content_view_version.rb
katello-3.15.3.1 app/models/katello/authorization/content_view_version.rb