(file) Return to AuthorizationHandler.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Security / UserManager

Diff for /pegasus/src/Pegasus/Security/UserManager/AuthorizationHandler.cpp between version 1.33 and 1.34

version 1.33, 2008/12/16 18:57:09 version 1.34, 2012/02/02 05:50:16
Line 125 
Line 125 
     CIMName("DisableIndicationSubscription")     CIMName("DisableIndicationSubscription")
 }; };
  
   static String _getAuthKey(const String &userName, const String &nameSpace)
   {
       //Separator ":" is used to distinguish "a" +"bc"
       // and "ab"+"c" scenarios
       String key = nameSpace;
       key.append(Char16(':'));
   #ifdef PEGASUS_OS_TYPE_WINDOWS
       key.append(userName);
       key.toLower();
   #else
       key.toLower();
       key.append(userName);
   #endif
   
       return key;
   }
  
 // //
 // Constructor // Constructor
Line 245 
Line 261 
             //             //
             // Add authorization to the table             // Add authorization to the table
             //             //
             if (!_authTable.insert(userName + nameSpace, auth))              if (!_authTable.insert(_getAuthKey(userName, nameSpace), auth))
             {             {
                 throw AuthorizationCacheError();                 throw AuthorizationCacheError();
             }             }
Line 273 
Line 289 
     PEG_METHOD_ENTER(     PEG_METHOD_ENTER(
         TRC_AUTHORIZATION, "AuthorizationHandler::setAuthorization()");         TRC_AUTHORIZATION, "AuthorizationHandler::setAuthorization()");
  
       String key = _getAuthKey(userName, nameSpace.getString());
     //     //
     // Remove auth if it already exists     // Remove auth if it already exists
     //     //
     _authTable.remove(userName + nameSpace.getString());      _authTable.remove(key);
  
     //     //
     // Insert the specified authorization     // Insert the specified authorization
     //     //
     if (!_authTable.insert(userName + nameSpace.getString(), auth))      if (!_authTable.insert(key, auth))
     {     {
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw AuthorizationCacheError();         throw AuthorizationCacheError();
Line 300 
Line 317 
     //     //
     // Remove the specified authorization     // Remove the specified authorization
     //     //
     if (!_authTable.remove(userName + nameSpace.getString()))      if (!_authTable.remove(_getAuthKey(userName, nameSpace.getString())))
     {     {
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw AuthorizationEntryNotFound(userName, nameSpace.getString());         throw AuthorizationEntryNotFound(userName, nameSpace.getString());
Line 320 
Line 337 
     //     //
     // Get authorization for the specified userName and nameSpace     // Get authorization for the specified userName and nameSpace
     //     //
     if (!_authTable.lookup(userName + nameSpace.getString(), auth))      if (!_authTable.lookup(_getAuthKey(userName, nameSpace.getString()), auth))
     {     {
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         throw AuthorizationEntryNotFound(userName, nameSpace.getString());         throw AuthorizationEntryNotFound(userName, nameSpace.getString());


Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2