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
834429a0
Commit
834429a0
authored
May 16, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code from policies module
parent
9f67c885
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
src/AccessControl/SimpleObjectPolicies.py
src/AccessControl/SimpleObjectPolicies.py
+0
-15
src/DocumentTemplate/security.py
src/DocumentTemplate/security.py
+17
-0
No files found.
src/AccessControl/SimpleObjectPolicies.py
View file @
834429a0
...
@@ -77,21 +77,6 @@ ContainerAssertions={
...
@@ -77,21 +77,6 @@ ContainerAssertions={
type
(
u''
):
1
,
type
(
u''
):
1
,
}
}
class
_dummy_class
:
pass
from
DocumentTemplate.DT_Util
import
TemplateDict
# Temporarily create a DictInstance so that we can mark its type as
# being a key in the ContainerAssertions.
templateDict
=
TemplateDict
()
try
:
dictInstance
=
templateDict
(
dummy
=
1
)[
0
]
if
type
(
dictInstance
)
is
not
type
(
_dummy_class
()):
ContainerAssertions
[
type
(
dictInstance
)]
=
1
except
:
# Hmm, this may cause _() and _.namespace() to fail.
# What to do?
pass
Containers
=
ContainerAssertions
.
get
Containers
=
ContainerAssertions
.
get
def
allow_type
(
Type
,
allowed
=
1
):
def
allow_type
(
Type
,
allowed
=
1
):
...
...
src/DocumentTemplate/security.py
View file @
834429a0
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
import
string
,
math
,
random
,
sets
import
string
,
math
,
random
,
sets
from
AccessControl
import
SecurityManagement
from
AccessControl
import
SecurityManagement
from
AccessControl.SimpleObjectPolicies
import
ContainerAssertions
from
AccessControl.ZopeGuards
import
safe_builtins
from
AccessControl.ZopeGuards
import
safe_builtins
import
DocumentTemplate.sequence
import
DocumentTemplate.sequence
...
@@ -106,3 +107,19 @@ for name, v in safe_builtins.items():
...
@@ -106,3 +107,19 @@ for name, v in safe_builtins.items():
if
name
.
startswith
(
'__'
):
if
name
.
startswith
(
'__'
):
continue
continue
setattr
(
DT_Util
.
TemplateDict
,
name
,
v
)
setattr
(
DT_Util
.
TemplateDict
,
name
,
v
)
class
_dummy_class
:
pass
# Temporarily create a DictInstance so that we can mark its type as
# being a key in the ContainerAssertions.
templateDict
=
DT_Util
.
TemplateDict
()
try
:
dictInstance
=
templateDict
(
dummy
=
1
)[
0
]
if
type
(
dictInstance
)
is
not
type
(
_dummy_class
()):
ContainerAssertions
[
type
(
dictInstance
)]
=
1
except
:
# Hmm, this may cause _() and _.namespace() to fail.
# What to do?
pass
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