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/rackspace/requests/databases/revoke_user_access.rb

26 lines
669 B
Ruby

module Fog
module Rackspace
class Databases
class Real
def revoke_user_access(instance_id, user, database)
user =
if user.respond_to?(:name) && user.respond_to?(:host)
host_str =
if user.host && user.host != '' && user.host != '%'
"@#{user.host}"
end.to_s
user.name + host_str
else
user
end
request(
:expects => 202,
:method => 'DELETE',
:path => "instances/#{instance_id}/users/#{user}/databases/#{database}"
)
end
end
end
end
end