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
b657adae
Commit
b657adae
authored
Jan 27, 2004
by
Brian Lloyd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge btree policy fix
parent
618f7fac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
lib/python/AccessControl/SimpleObjectPolicies.py
lib/python/AccessControl/SimpleObjectPolicies.py
+32
-1
No files found.
lib/python/AccessControl/SimpleObjectPolicies.py
View file @
b657adae
...
...
@@ -42,7 +42,7 @@ disallowed otherwise.
XXX This descrition doesn't actually match what's done in ZopeGuards
or in ZopeSecurityPolicy. :(
$Id: SimpleObjectPolicies.py,v 1.1
3 2004/01/15 23:09:03 tseaver
Exp $'''
$Id: SimpleObjectPolicies.py,v 1.1
4 2004/01/27 20:40:22 Brian
Exp $'''
_noroles
=
[]
# this is imported in various places
...
...
@@ -104,3 +104,34 @@ def allow_type(Type, allowed=1):
if
not
(
isinstance
(
allowed
,
int
)
or
isinstance
(
allowed
,
dict
)):
raise
ValueError
,
"The 'allowed' argument must be an int or dict."
ContainerAssertions
[
Type
]
=
allowed
#
# WAAAA!
#
from
BTrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
from
BTrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
for
tree_type
,
has_values
in
[(
OOBTree
,
1
),
(
OOBucket
,
1
),
(
OOSet
,
0
),
(
OIBTree
,
1
),
(
OIBucket
,
1
),
(
OISet
,
0
),
(
IOBTree
,
1
),
(
IOBucket
,
1
),
(
IOSet
,
0
),
(
IIBTree
,
1
),
(
IIBucket
,
1
),
(
IISet
,
0
),
]:
tree
=
tree_type
()
key_type
=
type
(
tree
.
keys
())
if
key_type
is
not
ListType
:
# lists have their own declarations
allow_type
(
key_type
)
if
has_values
:
assert
key_type
is
type
(
tree
.
values
())
assert
key_type
is
type
(
tree
.
items
())
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