1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/openstack/models/identity/roles.rb

27 lines
568 B
Ruby
Raw Normal View History

2012-02-22 09:40:32 -05:00
require 'fog/core/collection'
require 'fog/openstack/models/identity/role'
module Fog
module Identity
class OpenStack
class Roles < Fog::Collection
model Fog::Identity::OpenStack::Role
attribute :user
attribute :tenant
def all
requires :user, :tenant
load(connection.
list_roles_for_user_on_tenant(tenant.id, user.id).body['roles'])
end
2012-02-24 06:38:05 -05:00
def get(id)
2012-02-24 06:38:05 -05:00
connection.get_role(id)
end
end
2012-02-22 09:40:32 -05:00
end # class OpenStack
end # module Compute
end # module Fog