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
e37cf333
Commit
e37cf333
authored
Jun 21, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the RestrictedDTML class, a mix-in for derivatives of
DT_String.String that adds Zope security.
parent
ddea6236
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
lib/python/AccessControl/DTML.py
lib/python/AccessControl/DTML.py
+15
-2
No files found.
lib/python/AccessControl/DTML.py
View file @
e37cf333
...
...
@@ -84,13 +84,26 @@
##############################################################################
'''Add security system support to Document Templates
$Id: DTML.py,v 1.
6 2001/06/19 23:15:41 andreas
Exp $'''
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
$Id: DTML.py,v 1.
7 2001/06/21 17:16:31 shane
Exp $'''
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
from
DocumentTemplate
import
DT_Util
import
SecurityManagement
,
string
,
math
,
whrandom
,
random
import
DocumentTemplate.sequence
from
ZopeGuards
import
guarded_getattr
,
guarded_getitem
,
_marker
class
RestrictedDTML
:
'''
A mix-in for derivatives of DT_String.String that adds Zope security.
'''
def
guarded_getattr
(
self
,
ob
,
name
,
default
=
_marker
):
return
guarded_getattr
(
ob
,
name
,
default
)
def
guarded_getitem
(
self
,
ob
,
index
):
return
guarded_getitem
(
ob
,
index
)
# Allow access to unprotected attributes
DT_Util
.
TemplateDict
.
__allow_access_to_unprotected_subobjects__
=
1
string
.
__allow_access_to_unprotected_subobjects__
=
1
...
...
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