Sha256: f3453a255e2c6f9b0277c48a0a787007bfb053fb4a96c2aaea1bf5fef9acbb42

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Identity
    class OpenStack
      class V2
        class Real
          def list_roles_for_user_on_tenant(tenant_id, user_id)
            request(
              :expects => [200],
              :method  => 'GET',
              :path    => "tenants/#{tenant_id}/users/#{user_id}/roles"
            )
          end # def list_roles_for_user_on_tenant
        end # class Real

        class Mock
          def list_roles_for_user_on_tenant(tenant_id, user_id)
            data[:user_tenant_membership][tenant_id] ||= {}
            data[:user_tenant_membership][tenant_id][user_id] ||= []
            roles = data[:user_tenant_membership][tenant_id][user_id].map do |role_id|
              data[:roles][role_id]
            end

            Excon::Response.new(
              :body   => {'roles' => roles},
              :status => 200
            )
          end # def list_roles_for_user_on_tenant
        end # class Mock
      end # class V2
    end # class OpenStack
  end # module Identity
end # module Fog

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-openstack-0.1.25 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.24 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.23 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.22 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.21 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.20 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.19 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.18 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.17 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.15 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.14 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.13 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.12 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb
fog-openstack-0.1.11 lib/fog/identity/openstack/v2/requests/list_roles_for_user_on_tenant.rb