Show More
@@ -126,7 +126,7 b' class _PermCheckIterator(object):' | |||
|
126 | 126 | self.obj_list = obj_list |
|
127 | 127 | self.obj_attr = obj_attr |
|
128 | 128 | self.perm_set = perm_set |
|
129 | self.perm_checker = perm_checker | |
|
129 | self.perm_checker = perm_checker(*self.perm_set) | |
|
130 | 130 | self.extra_kwargs = extra_kwargs or {} |
|
131 | 131 | |
|
132 | 132 | def __len__(self): |
@@ -136,11 +136,10 b' class _PermCheckIterator(object):' | |||
|
136 | 136 | return '<%s (%s)>' % (self.__class__.__name__, self.__len__()) |
|
137 | 137 | |
|
138 | 138 | def __iter__(self): |
|
139 | checker = self.perm_checker(*self.perm_set) | |
|
140 | 139 | for db_obj in self.obj_list: |
|
141 | 140 | # check permission at this level |
|
142 | 141 | name = getattr(db_obj, self.obj_attr, None) |
|
143 | if not checker(name, self.__class__.__name__, **self.extra_kwargs): | |
|
142 | if not self.perm_checker(name, self.__class__.__name__, **self.extra_kwargs): | |
|
144 | 143 | continue |
|
145 | 144 | |
|
146 | 145 | yield db_obj |
General Comments 0
You need to be logged in to leave comments.
Login now