Revision 9ff398d0
src/oca/ruby/opennebula/acl.rb | ||
---|---|---|
41 | 41 |
USERS = { |
42 | 42 |
"UID" => 0x100000000, |
43 | 43 |
"GID" => 0x200000000, |
44 |
"ALL" => 0x400000000 |
|
44 |
"ALL" => 0x400000000, |
|
45 |
"CLUSTER" => 0x800000000 |
|
45 | 46 |
} |
46 | 47 |
|
47 | 48 |
RESOURCES = |
... | ... | |
236 | 237 |
# @return [Integer] the numeric value for the given id_str |
237 | 238 |
def self.calculate_ids(id_str) |
238 | 239 |
raise "ID string '#{id_str}' malformed" if |
239 |
!id_str.match(/^([\#@]\d+|\*)$/) |
|
240 |
!id_str.match(/^([\#@\%]\d+|\*)$/)
|
|
240 | 241 |
|
241 | 242 |
value = 0 |
242 | 243 |
|
... | ... | |
251 | 252 |
|
252 | 253 |
when "*" |
253 | 254 |
users_value = USERS["ALL"] |
255 |
|
|
256 |
when "%" |
|
257 |
value = USERS["CLUSTER"] |
|
258 |
users_value = id_str[1..-1].to_i + value |
|
254 | 259 |
end |
255 | 260 |
|
256 | 261 |
return users_value |
Also available in: Unified diff