entities/authobjs.py
branchstable
changeset 4246 c95b8c7e5fb2
parent 4212 ab6573088b4a
child 4252 6c4f109c2b03
child 4402 360c532070f5
--- a/entities/authobjs.py	Fri Jan 15 09:36:49 2010 +0100
+++ b/entities/authobjs.py	Mon Jan 18 11:50:34 2010 +0100
@@ -21,6 +21,7 @@
         """XXX goa specific"""
         return self.get('name')
 
+
 class CWUser(AnyEntity):
     id = 'CWUser'
     fetch_attrs, fetch_order = fetch_config(['login', 'firstname', 'surname'])
@@ -76,12 +77,12 @@
             groups = frozenset((groups,))
         elif isinstance(groups, (tuple, list)):
             groups = frozenset(groups)
-        return len(groups & self.groups)
+        return len(groups & self.groups) # XXX return the resulting set instead of its size
 
     def is_in_group(self, group):
         """convience / shortcut method to test if the user belongs to `group`
         """
-        return self.matching_groups(group) == 1
+        return group in self._groups
 
     def is_anonymous(self):
         """ checks if user is an anonymous user"""