view wiki/config/more_samples/groups_wikiconfig_snippet @ 4847:f0bcf3e1725d

Groups2009: Configuration snippets for groups.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Mon, 13 Jul 2009 16:55:17 +0200
parents
children c098b029cf60
line wrap: on
line source
    # This is a sample configuration snippet that shows moin's groups configuration
    # See HelpOnConfiguration for more info.

    # The wiki_groups backend is used by default.
    def group_manager_init(self, request):
        from MoinMoin.datastruct import WikiGroups
        return WikiGroups(request)

    # Use only groups defined in the configuration file.
    def group_manager_init(self, request):
        from MoinMoin.datastruct import ConfigGroups
        # Groups are defined here.
        groups = {u'EditorGroup': [u'AdminGroup', u'John', u'JoeDoe', u'Editor1'],
                  u'AdminGroup': [u'Admin1', u'Admin2', u'John']}
        return ConfigGroups(request, groups)

    # Use both config_groups and wiki_groups backends.
    def group_manager_init(self, request):
        from MoinMoin.datastruct import ConfigGroups, WikiGroups, CompositeGroups
        groups = {u'EditorGroup': [u'AdminGroup', u'John', u'JoeDoe', u'Editor1'],
                  u'AdminGroup': [u'Admin1', u'Admin2', u'John']}

        # Here ConfigGroups and WikiGroups backends are used.
        # Note that order matters! Since ConfigGroups backend is mentioned first
        # EditorGroup will be retrieved from it, not from WikiGroups.
        return CompositeGroups(request,
                               ConfigGroups(request, groups),
                               WikiGroups(request))