comparison MoinMoin/groups/backends/config_group.py @ 4805:6a109416e2b2

Groups2009: cfg.config_groups was removed.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 11 Jun 2009 14:08:13 +0200
parents 167db6117bb4
children dcbdf7e5660d
comparison
equal deleted inserted replaced
4804:3cea38408fe6 4805:6a109416e2b2
30 self.member_groups = member_groups 30 self.member_groups = member_groups
31 31
32 32
33 class Backend(BaseBackend): 33 class Backend(BaseBackend):
34 34
35 def __init__(self, request, groups=None): 35 def __init__(self, request, groups):
36 """ 36 """
37 @param groups: Dictionary of groups where key is group name, 37 @param groups: Dictionary of groups where key is group name,
38 and value is list of members of that group. 38 and value is list of members of that group.
39
40 If <groups> is not defined request.cfg.config_groups is used.
41 """ 39 """
42 super(Backend, self).__init__(request) 40 super(Backend, self).__init__(request)
43 41
44 if groups is not None: 42 self._groups = groups
45 self._groups = groups
46 else:
47 self._groups = request.cfg.config_groups
48 43
49 def __contains__(self, group_name): 44 def __contains__(self, group_name):
50 backend_group_name = self.to_backend_name(group_name) 45 backend_group_name = self.to_backend_name(group_name)
51 return self.page_group_regex.match(group_name) and backend_group_name in self._groups 46 return self.page_group_regex.match(group_name) and backend_group_name in self._groups
52 47