Commit 5570c555 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! [by Vincent] Get rid of all module-global callables. Use PAS API...

fixup! [by Vincent] Get rid of all module-global callables. Use PAS API instead. Use all non-PAS API public methods. Use PAS API instead. Implement IAuthenticationPlugin API better, so PAS API becomes usable for ERP5-based authentication.
parent 403ad307
......@@ -142,8 +142,9 @@ class ERP5UserManager(BasePlugin):
).dictionaries()
searchLogin = lambda **kw: unrestrictedSearchResults(
select_list=('parent_uid', 'reference'),
portal_type=login_portal_type,
portal_type=login_portal_type or [],
validation_state='validated',
**kw
).dictionaries()
if login is None:
# Only search by id if login is not given. Same logic as in
......@@ -177,7 +178,7 @@ class ERP5UserManager(BasePlugin):
login_dict = {}
if user_list:
for login in searchLogin(parent_uid=[x['uid'] for x in user_list]):
login_dict.setdefault(login.parent_uid).append(login)
login_dict.setdefault(login['parent_uid'], []).append(login)
if has_super_user:
user_list.append({'uid': None, 'reference': SUPER_USER})
else:
......@@ -193,11 +194,11 @@ class ERP5UserManager(BasePlugin):
reference={
'query': login,
'key': 'ExactMatch' if exact_match else 'Keyword',
}
},
limit=max_results,
):
if requested(login['refernce']):
login_dict.setdefault(login['parent_uid']).append(x)
if requested(login['reference']):
login_dict.setdefault(login['parent_uid'], []).append(login)
if login_dict:
user_list = searchUser(uid=list(login_dict))
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment