Back to index

plone3  3.1.7
interfaces.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 
00003 # XXX: These interfaces will be removed in a later version of borg.locarole.
00004 # You should use the interfaces in borg.localrole.interfaces instead!
00005 
00006 class IWorkspace(Interface):
00007     """A workspace in which custom local roles are needed
00008     
00009     A workspace gives information to the Pluggable Authentication Service 
00010     about local roles. The context will be adapted to this interface to 
00011     find out which additional local roles should apply.
00012     """
00013     
00014     def getLocalRolesForPrincipal(principal):
00015         """Return a sequence of all local roles for a principal.
00016         """
00017 
00018     def getLocalRoles():
00019         """Return a dictonary mapping principals to their roles within
00020         a workspace.
00021         """
00022 
00023 class IGroupAwareWorkspace(IWorkspace):
00024     """A group-aware version of IWorkspace.
00025     
00026     This should ensure that getLocalRolesForPrincipal() and getLocalRoles()
00027     return values for principals which are groups as well as principals
00028     which are users.
00029     
00030     Supporting only IWorkspace instead of IGroupAwareWorkspace will mean a
00031     slight performance increase, since there is no need to look up and
00032     iterate over groups.
00033     """