Commit 15570b8c authored by Jim Fulton's avatar Jim Fulton

Changed call to no-longer-supported validateValue methos to use the

validate method instead.

Use new getRoles function to get object roles, rather than using
__roles__ attribute.
parent 3535b932
...@@ -17,8 +17,8 @@ Aqueduct database adapters, etc. ...@@ -17,8 +17,8 @@ Aqueduct database adapters, etc.
This module can also be used as a simple template for implementing new This module can also be used as a simple template for implementing new
item types. item types.
$Id: SimpleItem.py,v 1.107 2003/11/18 13:17:03 tseaver Exp $''' $Id: SimpleItem.py,v 1.108 2003/11/28 16:45:42 jim Exp $'''
__version__='$Revision: 1.107 $'[11:-2] __version__='$Revision: 1.108 $'[11:-2]
import re, sys, Globals, App.Management, Acquisition, App.Undo import re, sys, Globals, App.Management, Acquisition, App.Undo
import AccessControl.Role, AccessControl.Owned, App.Common import AccessControl.Role, AccessControl.Owned, App.Common
...@@ -35,6 +35,7 @@ from zExceptions.ExceptionFormatter import format_exception ...@@ -35,6 +35,7 @@ from zExceptions.ExceptionFormatter import format_exception
from zExceptions import Redirect from zExceptions import Redirect
import time import time
from zLOG import LOG, BLATHER from zLOG import LOG, BLATHER
from AccessControl.ZopeSecurityPolicy import getRoles
import marshal import marshal
import ZDOM import ZDOM
...@@ -238,25 +239,32 @@ class Item(Base, Resource, CopySource, App.Management.Tabs, Traversable, ...@@ -238,25 +239,32 @@ class Item(Base, Resource, CopySource, App.Management.Tabs, Traversable,
from AccessControl.User import nobody from AccessControl.User import nobody
mode=0100000 mode=0100000
# check read permissions if (hasattr(aq_base(self),'manage_FTPget')):
if (hasattr(aq_base(self),'manage_FTPget') and
hasattr(self.manage_FTPget, '__roles__')):
try: try:
if getSecurityManager().validateValue(self.manage_FTPget): if getSecurityManager().validate(
None, self, 'manage_FTPget', self.manage_FTPget):
mode=mode | 0440 mode=mode | 0440
except: pass except Unauthorized:
if nobody.allowed(self.manage_FTPget, pass
self.manage_FTPget.__roles__):
if nobody.allowed(
self.manage_FTPget,
getRoles(self, 'manage_FTPget', self.manage_FTPget, ()),
):
mode=mode | 0004 mode=mode | 0004
# check write permissions # check write permissions
if hasattr(aq_base(self),'PUT') and hasattr(self.PUT, '__roles__'): if hasattr(aq_base(self),'PUT'):
try: try:
if getSecurityManager().validateValue(self.PUT): if getSecurityManager().validate(None, self, 'PUT', self.PUT):
mode=mode | 0220 mode=mode | 0220
except: pass except Unauthorized:
pass
if nobody.allowed(self.PUT, self.PUT.__roles__): if nobody.allowed(
self.PUT,
getRoles(self, 'PUT', self.PUT, ()),
):
mode=mode | 0002 mode=mode | 0002
# get size # get size
......
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