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
3a1222ab
Commit
3a1222ab
authored
Jun 01, 2006
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make python security policy work with a boolean __aatus__
parent
37a2b971
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
lib/python/AccessControl/ImplPython.py
lib/python/AccessControl/ImplPython.py
+1
-1
lib/python/AccessControl/tests/testZopeSecurityPolicy.py
lib/python/AccessControl/tests/testZopeSecurityPolicy.py
+8
-0
No files found.
lib/python/AccessControl/ImplPython.py
View file @
3a1222ab
...
...
@@ -317,7 +317,7 @@ class ZopeSecurityPolicy:
if
p
is
not
None
:
tp
=
p
.
__class__
if
tp
is
not
int
:
if
tp
is
not
int
and
tp
is
not
bool
:
if
tp
is
dict
:
if
isinstance
(
name
,
basestring
):
p
=
p
.
get
(
name
)
...
...
lib/python/AccessControl/tests/testZopeSecurityPolicy.py
View file @
3a1222ab
...
...
@@ -113,6 +113,11 @@ class UnprotectedSimpleItem (SimpleItemish):
__allow_access_to_unprotected_subobjects__
=
1
class
UnprotectedSimpleItemBool
(
SimpleItemish
):
__allow_access_to_unprotected_subobjects__
=
True
class
OwnedSimpleItem
(
UnprotectedSimpleItem
):
def
getOwner
(
self
,
info
=
0
):
if
info
:
...
...
@@ -159,6 +164,7 @@ class ZopeSecurityPolicyTestBase(unittest.TestCase):
a
=
App
()
self
.
a
=
a
a
.
item
=
UnprotectedSimpleItem
()
a
.
itemb
=
UnprotectedSimpleItemBool
()
self
.
item
=
a
.
item
a
.
r_item
=
RestrictedSimpleItem
()
a
.
item1
=
PartlyProtectedSimpleItem1
()
...
...
@@ -237,11 +243,13 @@ class ZopeSecurityPolicyTestBase(unittest.TestCase):
def
testAccessToUnprotectedSubobjects
(
self
):
item
=
self
.
item
itemb
=
self
.
a
.
itemb
r_item
=
self
.
a
.
r_item
item1
=
self
.
a
.
item1
item2
=
self
.
a
.
item2
item3
=
self
.
a
.
item3
self
.
assertPolicyAllows
(
item
,
'public_prop'
)
self
.
assertPolicyAllows
(
itemb
,
'public_prop'
)
self
.
assertPolicyDenies
(
r_item
,
'public_prop'
)
self
.
assertPolicyAllows
(
item1
,
'public_prop'
)
self
.
assertPolicyAllows
(
item2
,
'public_prop'
)
...
...
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