feature #4217: Add MarketPlace to acl rules

This commit is contained in:
Ruben S. Montero committed 2015-12-06 01:25:37 +01:00
1 parent 019966cd79
commit a4aa7dc798
5 files changed
+20 -12

No files matched your search

+6 -4
View File
@@ -28,7 +28,7 @@ const long long AclRule::CLUSTER_ID = 0x0000000800000000LL;
const long long AclRule::NONE_ID = 0x1000000000000000LL;
const int AclRule::num_pool_objects = 14;
const int AclRule::num_pool_objects = 15;
const PoolObjectSQL::ObjectType AclRule::pool_objects[] = {
PoolObjectSQL::VM,
PoolObjectSQL::HOST,
@@ -43,7 +43,8 @@ const PoolObjectSQL::ObjectType AclRule::pool_objects[] = {
PoolObjectSQL::ZONE,
PoolObjectSQL::SECGROUP,
PoolObjectSQL::VDC,
PoolObjectSQL::VROUTER
PoolObjectSQL::VROUTER,
PoolObjectSQL::MARKETPLACE
};
const int AclRule::num_auth_operations = 4;
@@ -58,7 +59,8 @@ const long long AclRule::INVALID_CLUSTER_OBJECTS =
PoolObjectSQL::VM | PoolObjectSQL::IMAGE | PoolObjectSQL::USER |
PoolObjectSQL::TEMPLATE | PoolObjectSQL::GROUP | PoolObjectSQL::ACL |
PoolObjectSQL::CLUSTER | PoolObjectSQL::DOCUMENT | PoolObjectSQL::ZONE |
PoolObjectSQL::SECGROUP | PoolObjectSQL::VDC | PoolObjectSQL::VROUTER;
PoolObjectSQL::SECGROUP | PoolObjectSQL::VDC | PoolObjectSQL::VROUTER |
PoolObjectSQL::MARKETPLACE;
const long long AclRule::INVALID_GROUP_OBJECTS =
PoolObjectSQL::HOST | PoolObjectSQL::GROUP | PoolObjectSQL::CLUSTER |
@@ -234,7 +236,7 @@ bool AclRule::malformed(string& error_str) const
oss << "[resource] type is missing";
}
if ( (resource & 0xFFF8000000000000LL) != 0 )
if ( (resource & 0xFFF0000000000000LL) != 0 )
{
if ( error )
{
+3 -3
View File
@@ -9,9 +9,9 @@
:size: 8
:right: true
:RES_VHNIUTGDCOZSvR:
:RES_VHNIUTGDCOZSvRM:
:desc: Which resource the rule applies to
:size: 18
:size: 19
:RID:
:desc: Resource ID
@@ -31,7 +31,7 @@
:default:
- :ID
- :USER
- :RES_VHNIUTGDCOZSvR
- :RES_VHNIUTGDCOZSvRM
- :RID
- :OPE_UMAC
- :ZONE
+6 -4
View File
@@ -44,7 +44,7 @@ private
def self.resource_mask(str)
resource_type=str.split("/")[0]
mask = "--------------"
mask = "---------------"
resource_type.split("+").each{|type|
case type
@@ -76,6 +76,8 @@ private
mask[12] = "v"
when "VROUTER"
mask[13] = "R"
when "MARKETPLACE"
mask[14] = "M"
end
}
mask
@@ -115,8 +117,8 @@ private
d['STRING'].split(" ")[0]
end
column :RES_VHNIUTGDCOZSvR, "Resource to which the rule applies",
:size => 18 do |d|
column :RES_VHNIUTGDCOZSvRM, "Resource to which the rule applies",
:size => 19 do |d|
OneAclHelper::resource_mask d['STRING'].split(" ")[1]
end
@@ -133,7 +135,7 @@ private
OneAclHelper::right_mask d['STRING'].split(" ")[2]
end
default :ID, :USER, :RES_VHNIUTGDCOZSvR, :RID, :OPE_UMAC, :ZONE
default :ID, :USER, :RES_VHNIUTGDCOZSvRM, :RID, :OPE_UMAC, :ZONE
end
table
@@ -72,6 +72,7 @@ public class Acl extends PoolElement{
tmpResources.put("SECGROUP" , 0x0001000000000000L);
tmpResources.put("VDC" , 0x0002000000000000L);
tmpResources.put("VROUTER" , 0x0004000000000000L);
tmpResources.put("MARKETPLACE", 0x0008000000000000L);
RESOURCES = Collections.unmodifiableMap(tmpResources);
+4 -1
View File
@@ -33,6 +33,8 @@ module OpenNebula
# ACL
# SECGROUP
# VDC
# VROUTER
# MARKETPLACE
# RIGHTS -> + separated list
# USE
# MANAGE
@@ -62,7 +64,8 @@ module OpenNebula
"ZONE" => 0x800000000000,
"SECGROUP" => 0x1000000000000,
"VDC" => 0x2000000000000,
"VROUTER" => 0x4000000000000
"VROUTER" => 0x4000000000000,
"MARKETPLACE" => 0x8000000000000
}
RIGHTS =