Ignore:
Timestamp:
19 May 2011, 13:46:42 (14 years ago)
Author:
uli
Message:

Move RoleSource? into interfaces -- we need interfaces in
permissions.py.

Rename names() to roles() - this describes much better what the method
provides.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r6141 r6143  
    1212from zope import schema
    1313from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
    14 from waeup.sirp.permissions import RoleSource
    1514
    1615
     
    2625    return SimpleVocabulary([
    2726            SimpleTerm(value, value, title) for title, value in terms])
     27
     28class RoleSource(BasicSourceFactory):
     29    def getValues(self):
     30        from waeup.sirp.permissions import getRoles
     31        return getRoles()
     32    def getTitle(self, value):
     33        if isinstance(value, basestring):
     34            return value.split('.', 2)[1]
    2835
    2936class IWAeUPObject(Interface):
     
    213220        """
    214221
    215     def names():
     222    def roles():
    216223        """Return a list of role names assignable.
    217224        """
Note: See TracChangeset for help on using the changeset viewer.