Commit cf0251db authored by 's avatar

Merged fixes missed from 2.3 branch

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