mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-15 18:50:09 +03:00
feature #687: DeleteRule returns the oid of the rule. AclManager initialized in constructor
This commit is contained in:
parent
84a19e69ad
commit
d60c98345b
@ -36,6 +36,9 @@ protected:
|
||||
{
|
||||
auth_object = AuthRequest::ACL;
|
||||
auth_op = AuthRequest::MANAGE;
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
aclm = nd.get_aclm();
|
||||
};
|
||||
|
||||
~RequestManagerAcl(){};
|
||||
@ -57,8 +60,8 @@ class AclAddRule : public RequestManagerAcl
|
||||
public:
|
||||
AclAddRule():
|
||||
RequestManagerAcl("AclAddRule",
|
||||
"Adds a new ACL rule",
|
||||
"A:ssss")
|
||||
"Adds a new ACL rule",
|
||||
"A:ssss")
|
||||
{};
|
||||
|
||||
~AclAddRule(){};
|
||||
@ -74,8 +77,8 @@ class AclDelRule : public RequestManagerAcl
|
||||
public:
|
||||
AclDelRule():
|
||||
RequestManagerAcl("AclDelRule",
|
||||
"Deletes an existing ACL rule",
|
||||
"A:si")
|
||||
"Deletes an existing ACL rule",
|
||||
"A:si")
|
||||
{};
|
||||
|
||||
~AclDelRule(){};
|
||||
@ -91,8 +94,8 @@ class AclInfo: public RequestManagerAcl
|
||||
public:
|
||||
AclInfo():
|
||||
RequestManagerAcl("AclInfo",
|
||||
"Returns the ACL rule set",
|
||||
"A:s")
|
||||
"Returns the ACL rule set",
|
||||
"A:s")
|
||||
{};
|
||||
|
||||
~AclInfo(){};
|
||||
|
@ -31,7 +31,6 @@ void AclAddRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
resource = xmlrpc_c::value_i8(paramList.getI8(2));
|
||||
rights = xmlrpc_c::value_i8(paramList.getI8(3));
|
||||
*/
|
||||
|
||||
long long user;
|
||||
long long resource;
|
||||
long long rights;
|
||||
@ -49,10 +48,6 @@ void AclAddRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
iss.str( xmlrpc_c::value_string(paramList.getString(3)) );
|
||||
iss >> hex >> rights;
|
||||
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
aclm = nd.get_aclm();
|
||||
|
||||
string error_msg;
|
||||
|
||||
if ( basic_authorization(-1) == false )
|
||||
@ -62,7 +57,6 @@ void AclAddRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
|
||||
int rc = aclm->add_rule(user, resource, rights, error_msg);
|
||||
|
||||
|
||||
if ( rc < 0 )
|
||||
{
|
||||
failure_response(INTERNAL, request_error(error_msg, ""));
|
||||
@ -79,11 +73,7 @@ void AclAddRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
|
||||
void AclDelRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
{
|
||||
int oid = xmlrpc_c::value_int(paramList.getInt(1));
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
aclm = nd.get_aclm();
|
||||
|
||||
int oid = xmlrpc_c::value_int(paramList.getInt(1));
|
||||
string error_msg;
|
||||
|
||||
if ( basic_authorization(-1) == false )
|
||||
@ -99,7 +89,7 @@ void AclDelRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
return;
|
||||
}
|
||||
|
||||
success_response("");
|
||||
success_response(oid);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -109,9 +99,6 @@ void AclDelRule::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
|
||||
void AclInfo::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
aclm = nd.get_aclm();
|
||||
|
||||
ostringstream oss;
|
||||
int rc;
|
||||
|
||||
@ -128,7 +115,7 @@ void AclInfo::request_execute(xmlrpc_c::paramList const& paramList)
|
||||
return;
|
||||
}
|
||||
|
||||
success_response( oss.str() );
|
||||
success_response(oss.str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user