feature #4369: Better const signature. Removed unused varibles and

methods. ACL filter is generated in the ClusterPool class, moved DB name
to private scope. Copy constructor for object collection. Uniform
get_cluster_id function.
This commit is contained in:
Ruben S. Montero committed 2016-03-21 13:01:45 +01:00
1 parent 568a529487
commit 3fb8a0e161
16 files changed
+138 -167

No files matched your search

+3 -29
View File
@@ -702,7 +702,8 @@ void PoolSQL::acl_filter(int uid,
{
filter.clear();
if ( uid == UserPool::ONEADMIN_ID || user_groups.count( GroupPool::ONEADMIN_ID ) == 1 )
if ( uid == UserPool::ONEADMIN_ID ||
user_groups.count( GroupPool::ONEADMIN_ID ) == 1 )
{
all = true;
return;
@@ -740,34 +741,7 @@ void PoolSQL::acl_filter(int uid,
acl_filter << " OR gid = " << *it;
}
if (auth_object == PoolObjectSQL::HOST)
{
for ( it = cids.begin(); it < cids.end(); it++ )
{
acl_filter << " OR cid = " << *it;
}
}
string cl_table;
if (auth_object == PoolObjectSQL::DATASTORE)
{
cl_table = Cluster::datastore_table;
}
else if (auth_object == PoolObjectSQL::NET)
{
cl_table = Cluster::network_table;
}
if (!cl_table.empty())
{
for ( it = cids.begin(); it < cids.end(); it++ )
{
acl_filter << " OR oid IN ("
<< "SELECT oid from " << cl_table
<< " WHERE cid = " << *it << ")";
}
}
ClusterPool::cluster_acl_filter(acl_filter, auth_object, cids);
filter = acl_filter.str();
}