[CMF-checkins] CVS: CMF/DCWorkflow - utils.py:1.9

Zachery Bir zbir at urbanape.com
Wed Mar 31 18:20:43 EST 2004


Update of /cvs-repository/CMF/DCWorkflow
In directory cvs.zope.org:/tmp/cvs-serv31743

Modified Files:
	utils.py 
Log Message:
in the utility functions, there is no longer any id mangling, as such,
what goes in is what comes out.


=== CMF/DCWorkflow/utils.py 1.8 => 1.9 ===
--- CMF/DCWorkflow/utils.py:1.8	Mon Jan 26 18:06:37 2004
+++ CMF/DCWorkflow/utils.py	Wed Mar 31 18:20:41 2004
@@ -64,18 +64,17 @@
 def modifyRolesForGroup(ob, group, grant_roles, managed_roles):
     """Modifies local roles for one group.
     """
-    moniker = "(Group) %s" % group
     local_roles = getattr(ob, '__ac_local_roles__', None)
     if local_roles is None:
         local_roles = {}
-    roles = local_roles.get(moniker)
+    roles = local_roles.get(group)
     if not roles:
         if not grant_roles:
             # No roles exist and no grants requested.  Leave unchanged.
             return 0
         else:
             # Add new roles for this group.
-            local_roles[moniker] = list(grant_roles)
+            local_roles[group] = list(grant_roles)
             ob.__ac_local_roles__ = local_roles
             return 1
     # Edit the roles.
@@ -91,9 +90,9 @@
             roles.remove(role)
             changed = 1
     if changed:
-        if not roles and local_roles.has_key(moniker):
-            del local_roles[moniker]
+        if not roles and local_roles.has_key(group):
+            del local_roles[group]
         else:
-            local_roles[moniker] = roles
+            local_roles[group] = roles
         ob.__ac_local_roles__ = local_roles
     return changed




More information about the CMF-checkins mailing list