Sha256: f633c2022fa8b60e31df6fe53ff8d2bfae4ccaa2d6a0cc4e3b5988287f508a40

Contents?: true

Size: 496 Bytes

Versions: 23

Compression:

Stored size: 496 Bytes

Contents

# To be replaced by find_resource, FindCommon after 1.6 support is deprecated
module ForemanDocker
  module FindContainer
    extend ActiveSupport::Concern

    def find_container
      if params[:id].blank?
        not_found
        return
      end
      @container = Container.authorized("#{action_permission}_#{controller_name}".to_sym)
                   .find(params[:id])
    end

    def allowed_resources
      ForemanDocker::Docker.authorized(:view_compute_resources)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
foreman_docker-1.2.0 app/controllers/concerns/foreman_docker/find_container.rb
foreman_docker-1.1.0 app/controllers/concerns/foreman_docker/find_container.rb
foreman_docker-1.0.1 app/controllers/concerns/foreman_docker/find_container.rb