diff --git a/src/acl/AclRule.cc b/src/acl/AclRule.cc index c6733e772f..269209aa5a 100644 --- a/src/acl/AclRule.cc +++ b/src/acl/AclRule.cc @@ -233,7 +233,7 @@ bool AclRule::malformed(string& error_str) const oss << "[resource] type is missing"; } - if ( (resource & 0xFFFE000000000000LL) != 0 ) + if ( (resource & 0xFFFC000000000000LL) != 0 ) { if ( error ) { diff --git a/src/cli/etc/oneacl.yaml b/src/cli/etc/oneacl.yaml index 42e09fbe30..0519e407d3 100644 --- a/src/cli/etc/oneacl.yaml +++ b/src/cli/etc/oneacl.yaml @@ -9,7 +9,7 @@ :size: 8 :right: true -:RES_VHNIUTGDCOZS: +:RES_VHNIUTGDCOZSv: :desc: Which resource the rule applies to :size: 16 @@ -31,7 +31,7 @@ :default: - :ID - :USER -- :RES_VHNIUTGDCOZS +- :RES_VHNIUTGDCOZSv - :RID - :OPE_UMAC - :ZONE diff --git a/src/cli/one_helper/oneacl_helper.rb b/src/cli/one_helper/oneacl_helper.rb index 01e5c0f82e..cfab4c091e 100644 --- a/src/cli/one_helper/oneacl_helper.rb +++ b/src/cli/one_helper/oneacl_helper.rb @@ -44,7 +44,7 @@ private def self.resource_mask(str) resource_type=str.split("/")[0] - mask = "------------" + mask = "-------------" resource_type.split("+").each{|type| case type @@ -72,6 +72,8 @@ private mask[10] = "Z" when "SECGROUP" mask[11] = "S" + when "VDC" + mask[12] = "v" end } mask @@ -111,7 +113,7 @@ private d['STRING'].split(" ")[0] end - column :RES_VHNIUTGDCOZS, "Resource to which the rule applies", + column :RES_VHNIUTGDCOZSv, "Resource to which the rule applies", :size => 16 do |d| OneAclHelper::resource_mask d['STRING'].split(" ")[1] end @@ -129,7 +131,7 @@ private OneAclHelper::right_mask d['STRING'].split(" ")[2] end - default :ID, :USER, :RES_VHNIUTGDCOZS, :RID, :OPE_UMAC, :ZONE + default :ID, :USER, :RES_VHNIUTGDCOZSv, :RID, :OPE_UMAC, :ZONE end table diff --git a/src/oca/java/src/org/opennebula/client/acl/Acl.java b/src/oca/java/src/org/opennebula/client/acl/Acl.java index 38e9d890c4..32a7344236 100644 --- a/src/oca/java/src/org/opennebula/client/acl/Acl.java +++ b/src/oca/java/src/org/opennebula/client/acl/Acl.java @@ -69,6 +69,8 @@ public class Acl extends PoolElement{ tmpResources.put("CLUSTER" , 0x0000200000000000L); tmpResources.put("DOCUMENT" , 0x0000400000000000L); tmpResources.put("ZONE" , 0x0000800000000000L); + tmpResources.put("SECGROUP" , 0x0001000000000000L); + tmpResources.put("VDC" , 0x0002000000000000L); RESOURCES = Collections.unmodifiableMap(tmpResources); diff --git a/src/oca/ruby/opennebula/acl.rb b/src/oca/ruby/opennebula/acl.rb index 67ab0398fa..2c93006b20 100644 --- a/src/oca/ruby/opennebula/acl.rb +++ b/src/oca/ruby/opennebula/acl.rb @@ -32,6 +32,7 @@ module OpenNebula # GROUP # ACL # SECGROUP + # VDC # RIGHTS -> + separated list # USE # MANAGE @@ -48,18 +49,19 @@ module OpenNebula RESOURCES = { - "VM" => 0x1000000000, - "HOST" => 0x2000000000, - "NET" => 0x4000000000, - "IMAGE" => 0x8000000000, - "USER" => 0x10000000000, - "TEMPLATE" => 0x20000000000, - "GROUP" => 0x40000000000, - "DATASTORE" => 0x100000000000, - "CLUSTER" => 0x200000000000, - "DOCUMENT" => 0x400000000000, - "ZONE" => 0x800000000000, - "SECGROUP" => 0x1000000000000 + "VM" => 0x1000000000, + "HOST" => 0x2000000000, + "NET" => 0x4000000000, + "IMAGE" => 0x8000000000, + "USER" => 0x10000000000, + "TEMPLATE" => 0x20000000000, + "GROUP" => 0x40000000000, + "DATASTORE" => 0x100000000000, + "CLUSTER" => 0x200000000000, + "DOCUMENT" => 0x400000000000, + "ZONE" => 0x800000000000, + "SECGROUP" => 0x1000000000000, + "VDC" => 0x2000000000000 } RIGHTS = diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 73873f63f8..a65b156fe1 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -106,6 +106,11 @@ var create_acl_tmpl = \ \ \ +
\ +
\ + \ +
\ +
\ \
\ '+tr("Resource subset")+'\ @@ -408,6 +413,9 @@ function parseAclString(string) { case "SECGROUP": resources_str+=tr("Security Groups")+", "; break; + case "VDC": + resources_str+=tr("VDCs")+", "; + break; }; }; //remove ", " from end