(file) Return to CIMOperationRequestAuthorizer.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Server

Diff for /pegasus/src/Pegasus/Server/CIMOperationRequestAuthorizer.cpp between version 1.23.4.1 and 1.23.4.2

version 1.23.4.1, 2003/07/29 15:08:30 version 1.23.4.2, 2003/08/13 19:39:55
Line 40 
Line 40 
 #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;
Line 400 
Line 403 
          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();
Line 441 
Line 470 
            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();


Legend:
Removed from v.1.23.4.1  
changed lines
  Added in v.1.23.4.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2