Commit 43feacc3 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

try erp5/acl_users authentication first in...

try erp5/acl_users authentication first in BaseExtensibleTraversableMixin._forceIdentification so that any Pluggable Auth Service authentication works.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43790 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 99d048f7
......@@ -96,11 +96,18 @@ class BaseExtensibleTraversableMixin(ExtensibleTraversableMixIn):
else:
has_published = True
try:
name = None
acl_users = self.getPortalObject().acl_users
user_list = acl_users._extractUserIds(request, acl_users.plugins)
if len(user_list) > 0:
name = user_list[0][0]
else:
auth = request._auth
# this logic is copied from identify() in
# AccessControl.User.BasicUserFolder.
if auth and auth.lower().startswith('basic '):
name = decodestring(auth.split(' ')[-1]).split(':', 1)[0]
if name is not None:
user = portal_membership._huntUser(name, self)
else:
user = None
......
......@@ -762,6 +762,12 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
response = self.publish('%s/%s?__ac_key=%s' %(base_url, web_page.getReference(),
key))
self.assertEqual(response.getStatus(), 200)
response = self.publish('%s/%s?__ac_name=%s&__ac_password=%s' % (
base_url, web_page.getReference(), reference, 'guest'))
self.assertEqual(response.getStatus(), 200)
response = self.publish('%s/%s?__ac_name=%s&__ac_password=%s' % (
base_url, web_page.getReference(), 'ERP5TypeTestCase', ''))
self.assertEqual(response.getStatus(), 200)
def testERP5ExternalAuthenticationPlugin(self):
"""
......
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