-if flash[:error]
  -if flash[:error].kind_of?(String)
    .flash-subset
      %div.heading
        =image_tag 'flash_error_icon.png', :alt => 'Errors'
        =flash[:error]
-else
  - @pool.catalogs.each do |catalog|
    %div.catalog_deployments_and_images
      %h1
        = catalog.name
        = t('.catalog')
      - catalog.deployables.each do |deployable|
        %h2
          = deployable.name
          = t('.deployable')

        - deployable.fetch_images.compact.each do |image|
          %h3
            = t('.image')
            = "#{image.name} (#{image.uuid})"

          %ul
            - image.provider_images.each do |provider_image|
              %li= t('.pushed', :uuid => provider_image.uuid, :provider => provider_image.provider_name)

-if flash[:error]
  -if flash[:error].kind_of?(String)
    .flash-subset
      %div.heading
        =image_tag 'flash_error_icon.png', :alt => 'Errors'
        =flash[:error]
-else
  - @pool.catalogs.list_for_user(current_user, Privilege::VIEW).each do |catalog|
    %div.catalog_deployments_and_images
      %h1
        = catalog.name
        = t('.catalog')
      - catalog.deployables.each do |deployable|
        %h2
          = deployable.name
          = t('.deployable')

        - deployable.fetch_images.compact.each do |image|
          %h3
            = t('.image')
            = "#{image.name} (#{image.uuid})"

          %ul
            - image.provider_images.each do |provider_image|
              %li= t('.pushed', :uuid => provider_image.uuid, :provider => provider_image.provider_name)

Fix permission checking on pools/_images
BZ788048: Fix permission checking on pools/_images

https://bugzilla.redhat.com/show_bug.cgi?id=788048

Resending it based on Scott's suggestion.
