Back to index

plone3  3.1.7
Functions | Variables
PlonePAS.ldapmp Namespace Reference

Functions

def getPropertiesForUser
def getGroupsForPrincipal

Variables

dictionary GROUP_PROPERTY_MAP
list KNOWN_ATTRS = []

Function Documentation

def PlonePAS.ldapmp.getGroupsForPrincipal (   self,
  user,
  request = None,
  attr = None 
)
Fulfill GroupsPlugin requirements, but don't return any groups for groups 

Definition at line 66 of file ldapmp.py.

00066 
00067 def getGroupsForPrincipal(self, user, request=None, attr=None):
00068     """ Fulfill GroupsPlugin requirements, but don't return any groups for groups """
00069 
00070     if not isinstance(user, PloneGroup):
00071         # It's not a PloneGroup, continue as usual
00072         return call(self, 'getGroupsForPrincipal', user, request=request, attr=attr)
00073 
00074     return ()
00075 
00076 wrap_method(LDAPMultiPlugin, 'getGroupsForPrincipal', getGroupsForPrincipal)

Here is the call graph for this function:

def PlonePAS.ldapmp.getPropertiesForUser (   self,
  user,
  request = None 
)
Fullfill PropertiesPlugin requirements

Definition at line 40 of file ldapmp.py.

00040 
00041 def getPropertiesForUser(self, user, request=None):
00042     """Fullfill PropertiesPlugin requirements
00043     """
00044 
00045     if not isinstance(user, PloneGroup):
00046         # It's not a PloneGroup, continue as usual
00047         return call(self, 'getPropertiesForUser', user=user, request=request)
00048 
00049     # We've got a PloneGroup.
00050     # Search for groups instead of users
00051     groups = self.enumerateGroups(id=user.getId(), exact_match=True)
00052     # XXX Should we assert there's only one group?
00053     properties = {}
00054     for group in groups:
00055         for pname, attrs in GROUP_PROPERTY_MAP.items():
00056             for attr in attrs:
00057                 value = group.get(attr)
00058                 if value:
00059                     # Break on first found
00060                     properties[pname] = value
00061                     break
00062 
00063     return properties
00064 
00065 wrap_method(LDAPPluginBase, 'getPropertiesForUser', getPropertiesForUser)

Here is the call graph for this function:


Variable Documentation

Initial value:
00001 {
00002     # target property: (possible key, ...)
00003     'title': ('name',
00004               'displayName',
00005               'cn',),
00006     'description': ('description', ),
00007     'email': ('mail', ),
00008     }

Definition at line 25 of file ldapmp.py.

Definition at line 34 of file ldapmp.py.