+
+ if self.getMode() == MODE_PASS_ANONYMOUS :
+ private_collections = portal.get('private_collections')
+ if not private_collections :
+ raise AccessControl_Unauthorized()
+ return
+ data = private_collections.data
+ lines = filter(None, [l.strip() for l in data.split('\n')])
+ assert len(lines) % 3 == 0
+ collecInfos = {}
+ for i in xrange(0, len(lines), 3) :
+ collecInfos[lines[i]] = {'pw' : lines[i+1],
+ 'path' : lines[i+2]}
+ if not (collecInfos.has_key(properties.get('collection_id')) and \
+ collecInfos[properties.get('collection_id')]['pw'] == properties.get('collection_password')) :
+ raise AccessControl_Unauthorized('Wrong primary credentials')
+ return
+
+
+ BaseRegistrationTool.addMember(self, id, password, roles=roles,
+ domains=domains, properties=properties)
+