Commit cf0251db authored by 's avatar

Merged fixes missed from 2.3 branch

parent b4af2142
......@@ -84,7 +84,7 @@
##############################################################################
"""Access control package"""
__version__='$Revision: 1.144 $'[11:-2]
__version__='$Revision: 1.145 $'[11:-2]
import Globals, socket, ts_regex, SpecialUsers
import os
......@@ -603,11 +603,10 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
# We found a user, his password was correct, and the user
# wasn't the emergency user. We need to authorize the user
# against the published object.
if self.authorize(user.__of__(self), a, c, n, v, roles):
if self.authorize(user, a, c, n, v, roles):
return user.__of__(self)
# That didn't work. Try to authorize the anonymous user.
elif self._isTop() and self.authorize(self._nobody.__of__(self),
a,c,n,v,roles):
elif self._isTop() and self.authorize(self._nobody,a,c,n,v,roles):
return self._nobody.__of__(self)
else:
# we can't authorize the user, and we either can't authorize
......@@ -627,8 +626,7 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
if self.authenticate(
user.getUserName(), '', request
):
if self.authorize(user.__of__(self), a, c,
n, v, roles):
if self.authorize(user, a, c, n, v, roles):
return user.__of__(self)
user = self.getUser(name)
......@@ -646,7 +644,7 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
elif user is None:
# we didn't find the username in this database
# try to authorize and return the anonymous user.
if self._isTop() and self.authorize(self._nobody.__of__(self),
if self._isTop() and self.authorize(self._nobody,
a, c, n, v, roles):
return self._nobody.__of__(self)
else:
......@@ -656,11 +654,11 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
else:
# We found a user and the user wasn't the emergency user.
# We need to authorize the user against the published object.
if self.authorize(user.__of__(self), a, c, n, v, roles):
if self.authorize(user, a, c, n, v, roles):
return user.__of__(self)
# That didn't work. Try to authorize the anonymous user.
elif self._isTop() and self.authorize(
self._nobody.__of__(self), a, c, n, v, roles):
self._nobody, a, c, n, v, roles):
return self._nobody.__of__(self)
else:
# we can't authorize the user, and we either can't
......
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