From 9ff398d03f3dd98ea1667eae2e962e80c95b2159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 16 Jan 2013 18:30:12 +0100 Subject: [PATCH] Feature #1565: Add new resource ID bit % in ruby OCA --- src/oca/ruby/opennebula/acl.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/oca/ruby/opennebula/acl.rb b/src/oca/ruby/opennebula/acl.rb index a443be8eda..d1a9660434 100644 --- a/src/oca/ruby/opennebula/acl.rb +++ b/src/oca/ruby/opennebula/acl.rb @@ -41,7 +41,8 @@ module OpenNebula USERS = { "UID" => 0x100000000, "GID" => 0x200000000, - "ALL" => 0x400000000 + "ALL" => 0x400000000, + "CLUSTER" => 0x800000000 } RESOURCES = @@ -236,7 +237,7 @@ private # @return [Integer] the numeric value for the given id_str def self.calculate_ids(id_str) raise "ID string '#{id_str}' malformed" if - !id_str.match(/^([\#@]\d+|\*)$/) + !id_str.match(/^([\#@\%]\d+|\*)$/) value = 0 @@ -251,6 +252,10 @@ private when "*" users_value = USERS["ALL"] + + when "%" + value = USERS["CLUSTER"] + users_value = id_str[1..-1].to_i + value end return users_value