Sha256: 6f2ecfba497b098a764d71c1cebd981421e0f6039aeda47add8ce18720fff3f9

Contents?: true

Size: 791 Bytes

Versions: 135

Compression:

Stored size: 791 Bytes

Contents

module Katello
  module Authorization::ActivationKey
    extend ActiveSupport::Concern

    include Authorizable

    def readable?
      authorized?(:view_activation_keys)
    end

    def editable?
      authorized?(:edit_activation_keys)
    end

    def deletable?
      authorized?(:destroy_activation_keys)
    end

    module ClassMethods
      def readable
        authorized(:view_activation_keys)
      end

      def editable
        authorized(:edit_activation_keys)
      end

      def any_editable?
        editable.count > 0
      end

      def all_editable?(content_view, environments)
        key_query = ActivationKey.where(:content_view_id => content_view, :environment_id => environments)
        key_query.count == key_query.editable.count
      end
    end
  end
end

Version data entries

135 entries across 135 versions & 1 rubygems

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