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:
parent
5b58d88be3
commit
c94ff96cd7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user