Ah That would explain it!
How about this, instead of an attribute, I created a method:
def icon(self):
return 'misc_/Squishdot/squishfile_img'
This seemed to work. Attached is the patch. Comments?
-Lance
On Tue, 22 Aug 2000, Chris Withers wrote:
> Lance wrote:
> > I think you have to not only
> > inherit RoleManager, but OFS.SimpleItem.Item as well. At least, that's what
> > the Security HOWTO seems to imply.
>
> No, it shouldn't :(
>
> SimpleItem.Item has __allow_access_to_unprotected_subobjects__=1 in it,
> so it just masks the problem rather than solving it properly...
>
> cheers,
>
> Chris
>
*** Squishfile.py Tue Aug 22 09:50:10 2000
--- Squishfile.py.orig Mon Aug 21 20:21:01 2000
***
*** 127,144
from Globals import Persistent
from Acquisition import Acquirer
from Globals import HTML
! from ImageFile import ImageFile
! from AccessControl.Role import RoleManager
!
#from creosote import spew
sep=re.compile('|/|:') # handle windows(\)/unix(/)/mac(:) path separators
! class Squishfile(Acquirer,Persistent,RoleManager):
""" """
! __ac_permissions__=(
! ('Use Squishfile Objects',['file_name','file_type','content_type',
'file_kbytes', 'date_created','date_modified','icon','file_bytes'], ('Anonymous',
'Manager')),
! )
_types={'application/octet-stream': 'Binary File',
'application/x-gzip' : 'Compressed File',
'application/x-compress': 'Compressed File',
--- 127,141
from Globals import Persistent
from Acquisition import Acquirer
from Globals import HTML
! from ImageFile import ImageFile
#from creosote import spew
sep=re.compile('|/|:') # handle windows(\)/unix(/)/mac(:) path separators
! class Squishfile(Acquirer,Persistent):
""" """
! icon='misc_/Squishdot/squishfile_img'
!
_types={'application/octet-stream': 'Binary File',
'application/x-gzip' : 'Compressed File',
'application/x-compress': 'Compressed File',
***
*** 173,180
#spew('sqf ctype: ' + self._ctype)
self._created =time.time()
self._modified=self._created
- def icon(self):
- return 'misc_/Squishdot/squishfile_img'
def content_type(self):
""" content type """
--- 170,175
***
*** 213,221
return self._file
index_html=__repr__
-
-
-
-
-
-
--- 208,210