[CMF-checkins] CVS: CMF/CMFCollector - util.py:1.2

Ken Manheimer klm@zope.com
Fri, 12 Oct 2001 14:07:54 -0400


Update of /cvs-repository/CMF/CMFCollector
In directory cvs.zope.org:/tmp/cvs-serv16013

Modified Files:
	util.py 
Log Message:
Moved add_local_role() from Collector.


=== CMF/CMFCollector/util.py 1.1 => 1.2 ===
         got.append(' ' + i)
     return string.join(got, '\n')
+
+def add_local_role(object, userid, roleid):
+    """Add object roleid for userid if not already there."""
+    roles = list(object.get_local_roles_for_userid(userid))
+    if roleid not in roles:
+        roles.append(roleid)
+        object.manage_setLocalRoles(userid, roles)