version 1.23.4.1, 2003/07/29 15:08:30
|
version 1.23.4.2, 2003/08/13 19:39:55
|
|
|
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include "CIMOperationRequestAuthorizer.h" | #include "CIMOperationRequestAuthorizer.h" |
| |
|
// l10n |
|
#include <Pegasus/Common/MessageLoader.h> |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
|
|
if ( !userManager || !userManager->verifyAuthorization( | if ( !userManager || !userManager->verifyAuthorization( |
userName, nameSpace, cimMethodName) ) | userName, nameSpace, cimMethodName) ) |
{ | { |
String description = "Not authorized to run "; |
|
description.append(cimMethodName); |
// l10n |
description.append(" in the namespace "); |
|
description.append(nameSpace.getString()); |
// String description = "Not authorized to run "; |
|
// description.append(cimMethodName); |
|
// description.append(" in the namespace "); |
|
// description.append(nameSpace.getString()); |
| |
if (cimMethodName == "InvokeMethod") | if (cimMethodName == "InvokeMethod") |
{ | { |
|
// l10n |
sendMethodError( | sendMethodError( |
queueId, | queueId, |
request->getHttpMethod(), | request->getHttpMethod(), |
((CIMRequestMessage*)request)->messageId, | ((CIMRequestMessage*)request)->messageId, |
((CIMInvokeMethodRequestMessage*)request)->methodName, | ((CIMInvokeMethodRequestMessage*)request)->methodName, |
PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, description)); |
PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, |
|
MessageLoaderParms( |
|
"Server.CIMOperationRequestAuthorizer.NOT_AUTHORIZED", |
|
"Not authorized to run $0 in the namespace $1", |
|
cimMethodName, nameSpace.getString()))); |
|
// sendMethodError( |
|
// queueId, |
|
// request->getHttpMethod(), |
|
// ((CIMRequestMessage*)request)->messageId, |
|
// ((CIMInvokeMethodRequestMessage*)request)->methodName, |
|
// PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, description)); |
} | } |
else | else |
{ | { |
|
// l10n |
sendIMethodError( | sendIMethodError( |
queueId, | queueId, |
request->getHttpMethod(), | request->getHttpMethod(), |
((CIMRequestMessage*)request)->messageId, | ((CIMRequestMessage*)request)->messageId, |
cimMethodName, | cimMethodName, |
PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, description)); |
PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, |
|
MessageLoaderParms( |
|
"Server.CIMOperationRequestAuthorizer.NOT_AUTHORIZED", |
|
"Not authorized to run $0 in the namespace $1", |
|
cimMethodName, nameSpace.getString()))); |
|
|
|
// sendIMethodError( |
|
// queueId, |
|
// request->getHttpMethod(), |
|
// ((CIMRequestMessage*)request)->messageId, |
|
// cimMethodName, |
|
// PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, description)); |
} | } |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
configManager->getCurrentValue("enableRemotePrivilegedUserAccess"), | configManager->getCurrentValue("enableRemotePrivilegedUserAccess"), |
"true") ) | "true") ) |
{ | { |
String description = |
|
"Remote privileged user access is not enabled."; |
|
| |
if (cimMethodName == "InvokeMethod") | if (cimMethodName == "InvokeMethod") |
{ | { |
|
|
|
// l10n |
|
|
sendMethodError( | sendMethodError( |
queueId, | queueId, |
request->getHttpMethod(), | request->getHttpMethod(), |
((CIMRequestMessage*)request)->messageId, | ((CIMRequestMessage*)request)->messageId, |
((CIMInvokeMethodRequestMessage*)request)->methodName, | ((CIMInvokeMethodRequestMessage*)request)->methodName, |
PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, description)); |
PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, MessageLoaderParms( |
|
"Server.CIMOperationRequestAuthorizer.REMOTE_NOT_ENABLED", "Remote privileged user access is not enabled."))); |
|
|
|
// sendMethodError( |
|
// queueId, |
|
// request->getHttpMethod(), |
|
// ((CIMRequestMessage*)request)->messageId, |
|
// ((CIMInvokeMethodRequestMessage*)request)->methodName, |
|
// PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, "Remote privileged user access is not enabled.")); |
} | } |
else | else |
{ | { |
|
// l10n |
|
|
sendIMethodError( | sendIMethodError( |
queueId, | queueId, |
request->getHttpMethod(), | request->getHttpMethod(), |
((CIMRequestMessage*)request)->messageId, | ((CIMRequestMessage*)request)->messageId, |
cimMethodName, | cimMethodName, |
PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, description)); |
PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, MessageLoaderParms( |
|
"Server.CIMOperationRequestAuthorizer.REMOTE_NOT_ENABLED", "Remote privileged user access is not enabled."))); |
|
|
|
// sendIMethodError( |
|
// queueId, |
|
// request->getHttpMethod(), |
|
// ((CIMRequestMessage*)request)->messageId, |
|
// cimMethodName, |
|
// PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, "Remote privileged user access is not enabled.")); |
} | } |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |