mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[openstack|identity] Correction in Roles#all method
User#roles should be calling Service#list_roles_for_user_on_tenant directly and not use Roles#all since the latter is actually a method for getting all roles in the Identity Service
This commit is contained in:
parent
f334670a75
commit
0d9b04b104
2 changed files with 3 additions and 14 deletions
|
@ -7,13 +7,8 @@ module Fog
|
|||
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'])
|
||||
load(connection.list_roles.body['roles'])
|
||||
end
|
||||
|
||||
def get(id)
|
||||
|
|
|
@ -54,14 +54,8 @@ module Fog
|
|||
true
|
||||
end
|
||||
|
||||
def roles
|
||||
return Array.new unless tenant_id
|
||||
tenant = Fog::Identity::OpenStack::Tenant.
|
||||
new(connection.get_tenant(tenant_id).body['tenant'])
|
||||
|
||||
connection.roles(
|
||||
:tenant => tenant,
|
||||
:user => self)
|
||||
def roles(tenant_id = self.tenant_id)
|
||||
connection.list_roles_for_user_on_tenant(tenant_id, self.id).body['roles']
|
||||
end
|
||||
end # class User
|
||||
end # class OpenStack
|
||||
|
|
Loading…
Reference in a new issue