1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

Add OpenNebula::User::group methods to get all groups from a user

This commit is contained in:
Ruben S. Montero 2014-03-13 13:49:00 +01:00
parent 5b58d88be3
commit c94ff96cd7

View File

@ -172,8 +172,8 @@ module OpenNebula
end
# Sets the user quota limits
# @param quota [String] a template (XML or txt) with the new quota limits
#
# @param quota [String] a template (XML or txt) with the new quota limits
#
# @return [nil, OpenNebula::Error] nil in case of success, Error
# otherwise
def set_quota(quota)
@ -194,5 +194,12 @@ module OpenNebula
def gid
self['GID'].to_i
end
# Returns a list with all the group IDs for the user including primary
# [return] _Array_ with the group ID's (as integers)
def groups
all_groups = self.retrieve_elements("GROUPS/ID")
all_groups.collect! {|x| x.to_i}
end
end
end