From ff9f67b2a378b29ff78e814ddb6f8818f618d695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 5 Aug 2011 16:41:03 +0200 Subject: [PATCH] Feature #718: Add new DEPLOY operation in Ruby OCA and CLI --- src/cli/etc/oneacl.yaml | 6 +++--- src/cli/one_helper/oneacl_helper.rb | 15 +++++++++------ src/oca/ruby/OpenNebula/Acl.rb | 4 +++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/cli/etc/oneacl.yaml b/src/cli/etc/oneacl.yaml index 19402950a1..7aa5a34c0a 100644 --- a/src/cli/etc/oneacl.yaml +++ b/src/cli/etc/oneacl.yaml @@ -18,9 +18,9 @@ :size: 5 :right: true -:OPE_CDUMIPpTW: +:OPE_CDUMIPpTWd: :desc: Operation to which the rule applies - :size: 13 + :size: 14 :right: true :default: @@ -28,4 +28,4 @@ - :USER - :RES_VHNIUTG - :RID -- :OPE_CDUMIPpTW +- :OPE_CDUMIPpTWd diff --git a/src/cli/one_helper/oneacl_helper.rb b/src/cli/one_helper/oneacl_helper.rb index db06e5f5a0..40e03192f0 100644 --- a/src/cli/one_helper/oneacl_helper.rb +++ b/src/cli/one_helper/oneacl_helper.rb @@ -69,7 +69,7 @@ private # TODO check that @content[:resources_str] is valid def self.right_mask(str) - mask = "---------" + mask = "----------" str.split("+").each{|type| case type @@ -91,6 +91,8 @@ private mask[7] = "T" when "CHOWN" mask[8] = "W" + when "DEPLOY" + mask[9] = "d" end } @@ -111,20 +113,21 @@ private d['STRING'].split(" ")[0] end - column :RES_VHNIUTG, "Resource to which the rule applies" do |d| + column :RES_VHNIUTG, "Resource to which the rule applies", + :size => 11 do |d| OneAclHelper::resource_mask d['STRING'].split(" ")[1] end - column :RID, "Resource ID", :right, :size=>8 do |d| + column :RID, "Resource ID", :right, :size=>5 do |d| d['STRING'].split(" ")[1].split("/")[1] end - column :OPE_CDUMIPpTW, - "Operation to which the rule applies" do |d| + column :OPE_CDUMIPpTWd, + "Operation to which the rule applies", :size =>14 do |d| OneAclHelper::right_mask d['STRING'].split(" ")[2] end - default :ID, :USER, :RES_VHNIUTG, :RID, :OPE_CDUMIPpTW + default :ID, :USER, :RES_VHNIUTG, :RID, :OPE_CDUMIPpTWd end table diff --git a/src/oca/ruby/OpenNebula/Acl.rb b/src/oca/ruby/OpenNebula/Acl.rb index 8a1e7bb95d..b61bb24d22 100644 --- a/src/oca/ruby/OpenNebula/Acl.rb +++ b/src/oca/ruby/OpenNebula/Acl.rb @@ -39,6 +39,7 @@ module OpenNebula # INFO_POOL_MINE # INSTANTIATE # CHOWN + # DEPLOY class Acl < PoolElement USERS = { @@ -68,7 +69,8 @@ module OpenNebula "INFO_POOL" => 0x20, # Auth. to view any object in the pool "INFO_POOL_MINE"=> 0x40, # Auth. to view user and/or group objects "INSTANTIATE" => 0x80, # Auth. to instantiate a VM from a TEMPLATE - "CHOWN" => 0x100 # Auth. to change ownership of an object + "CHOWN" => 0x100,# Auth. to change ownership of an object + "DEPLOY" => 0x200 # Auth. to deploy a VM in a Host } # Constructor