Sha256: 4121b0b6c9913874b07e930d739b797427257b85c506215608ccf8c4497e61cf

Contents?: true

Size: 1.02 KB

Versions: 25

Compression:

Stored size: 1.02 KB

Contents

module Katello
  module Authorization::Organization
    extend ActiveSupport::Concern

    include Authorizable

    def editable?
      authorized?(:edit_organizations)
    end

    def manifest_importable?
      authorized?(:import_manifest)
    end

    def can_import_library_content?
      authorized?(:import_library_content)
    end

    def can_export_library_content?
      authorized?(:export_library_content)
    end

    def readable_promotion_paths
      permissible_promotion_paths(KTEnvironment.readable)
    end

    def promotable_promotion_paths
      permissible_promotion_paths(KTEnvironment.promotable)
    end

    def permissible_promotion_paths(permissible_environments)
      promotion_paths.select do |promotion_path|
        # if at least one environment in the path is permissible
        # the path is deemed permissible.
        (promotion_path - permissible_environments).size != promotion_path.size
      end
    end

    def subscriptions_readable?
      User.current.can?(:view_subscriptions)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
katello-4.0.3 app/models/katello/authorization/organization.rb
katello-3.18.5 app/models/katello/authorization/organization.rb
katello-4.0.2.1 app/models/katello/authorization/organization.rb
katello-4.0.2 app/models/katello/authorization/organization.rb
katello-3.18.4 app/models/katello/authorization/organization.rb
katello-4.0.1.2 app/models/katello/authorization/organization.rb
katello-3.18.3.1 app/models/katello/authorization/organization.rb
katello-4.1.0.rc2.2 app/models/katello/authorization/organization.rb
katello-4.1.0.rc2.1 app/models/katello/authorization/organization.rb
katello-4.0.1.1 app/models/katello/authorization/organization.rb
katello-3.18.3 app/models/katello/authorization/organization.rb
katello-4.1.0.rc2 app/models/katello/authorization/organization.rb
katello-4.0.1 app/models/katello/authorization/organization.rb
katello-4.1.0.rc1.1 app/models/katello/authorization/organization.rb
katello-4.1.0.rc1 app/models/katello/authorization/organization.rb
katello-4.0.0 app/models/katello/authorization/organization.rb
katello-4.0.0.rc3.1 app/models/katello/authorization/organization.rb
katello-4.0.0.rc3 app/models/katello/authorization/organization.rb
katello-3.18.2.1 app/models/katello/authorization/organization.rb
katello-3.18.2 app/models/katello/authorization/organization.rb