Guest User

Untitled

a guest
Jul 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1.  
  2.  
  3. *******************************************************************************
  4. /Users/ems174/Desktop/Products.PluggableAuthService-esteele.diff
  5. *******************************************************************************
  6.  
  7. Index: /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/plugins/ZODBGroupManager.py
  8. ===================================================================
  9. --- /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/plugins/ZODBGroupManager.py (revision 108077)
  10. +++ /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/plugins/ZODBGroupManager.py (working copy)
  11. @@ -186,16 +186,17 @@
  12. }
  13.  
  14. security.declarePrivate( 'updateGroup' )
  15. - def updateGroup( self, group_id, title, description ):
  16. + def updateGroup( self, group_id, title=None, description=None ):
  17.  
  18. """ Update properties for 'group_id'
  19.  
  20. o Raise KeyError if group_id doesn't already exist.
  21. """
  22. - self._groups[ group_id ].update({ 'title' : title
  23. - , 'description' : description
  24. - })
  25. - self._groups[ group_id ] = self._groups[ group_id ]
  26. + if title is not None:
  27. + self._groups[group_id]['title'] = title
  28. + if description is not None:
  29. + self._groups[group_id]['description'] = description
  30. + self._groups[group_id] = self._groups[group_id]
  31.  
  32. security.declarePrivate( 'removeGroup' )
  33. def removeGroup( self, group_id ):
  34. Index: /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py
  35. ===================================================================
  36. --- /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py (revision 108077)
  37. +++ /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py (working copy)
  38. @@ -95,6 +95,19 @@
  39. group_info = zgm.getGroupInfo( 'group' )
  40. self.assertEqual( group_info['title'], 'group_title_changed' )
  41.  
  42. + def test_updateGroup_independent(self):
  43. + zgm = self._makeOne()
  44. +
  45. + zgm.addGroup( 'group', 'group_title', 'group_desc' )
  46. +
  47. + zgm.updateGroup( 'group', title='group_title_changed_again')
  48. + group_info = zgm.getGroupInfo( 'group' )
  49. + self.assertEqual( group_info['description'], 'group_desc' )
  50. + zgm.updateGroup( 'group', description='group_description_changed_again')
  51. + group_info = zgm.getGroupInfo( 'group' )
  52. + self.assertEqual( group_info['title'], 'group_title_changed_again' )
  53. +
  54. +
  55. def test_addPrincipalToGroup( self ):
  56. zgm = self._makeOne()
  57.  
  58. Index: /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/version.txt
  59. ===================================================================
  60. --- /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/version.txt (revision 108077)
  61. +++ /Users/ems174/plone4dev/src/Products.PluggableAuthService/Products/PluggableAuthService/version.txt (working copy)
  62. @@ -1 +1 @@
  63. -1.7.0b1
  64. +1.7.0b2
  65. Index: /Users/ems174/plone4dev/src/Products.PluggableAuthService/CHANGES.txt
  66. ===================================================================
  67. --- /Users/ems174/plone4dev/src/Products.PluggableAuthService/CHANGES.txt (revision 108077)
  68. +++ /Users/ems174/plone4dev/src/Products.PluggableAuthService/CHANGES.txt (working copy)
  69. @@ -1,6 +1,12 @@
  70. Change Log
  71. ==========
  72.  
  73. +
  74. +1.7.0b2 (Unreleased)
  75. +--------------------
  76. +
  77. +- Modify ZODBGroupManager to update group title and description independently.
  78. +
  79. 1.7.0b1 (2009-11-16)
  80. --------------------
Add Comment
Please, Sign In to add comment