Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
895498c9
Commit
895498c9
authored
Apr 28, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redid logic in oldvalidate so that access is not always provided for
unacquired objects that don't have roles.
parent
8ee1346f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
lib/python/OFS/DTMLMethod.py
lib/python/OFS/DTMLMethod.py
+23
-10
No files found.
lib/python/OFS/DTMLMethod.py
View file @
895498c9
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""DTML Method objects."""
__version__
=
'$Revision: 1.
19
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
20
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
,
lower
...
...
@@ -173,21 +173,34 @@ class DTMLMethod(cDocument, HTML, Acquisition.Implicit, RoleManager,
getSize
=
get_size
def
oldvalidate
(
self
,
inst
,
parent
,
name
,
value
,
md
):
#################################################################
# Note that this method is not used normally. It is simply a
# Python rendition of the validate method implemented in
# DocumentTemplate.cDocumentTemplate. The Python version
# serves the role of a requirements spec for the C version and
# can also be useful (if temporarily renamed to validate) for
# debugging.
#################################################################
if
name
[:
3
]
==
'aq_'
and
name
!=
'aq_parent'
and
name
!=
'aq_explicit'
:
return
0
if
hasattr
(
value
,
'__roles__'
):
roles
=
value
.
__roles__
elif
inst
is
parent
:
return
1
# Try to get roles
if
hasattr
(
value
,
'__roles__'
):
roles
=
value
.
__roles__
else
:
# if str(name)[:6]=='manage': return 0
if
hasattr
(
parent
,
'__roles__'
):
roles
=
parent
.
__roles__
if
hasattr
(
parent
,
'__roles__'
):
roles
=
parent
.
__roles__
elif
hasattr
(
parent
,
'aq_acquire'
):
try
:
roles
=
parent
.
aq_acquire
(
'__roles__'
)
except
AttributeError
:
return
0
else
:
return
0
except
AttributeError
:
if
hasattr
(
inst
,
'aq_base'
):
inst
=
inst
.
aq_base
if
hasattr
(
parent
,
'aq_base'
):
parent
=
parent
.
aq_base
return
inst
is
parent
else
:
if
hasattr
(
inst
,
'aq_base'
):
inst
=
inst
.
aq_base
if
hasattr
(
parent
,
'aq_base'
):
parent
=
parent
.
aq_base
return
inst
is
parent
value
=
parent
if
roles
is
None
:
return
1
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment