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
df62dab6
Commit
df62dab6
authored
Mar 23, 2006
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SecurityManager.validateValue no longer works, so better not use it...
parent
f0cc9dd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
lib/python/Testing/ZopeTestCase/testPythonScript.py
lib/python/Testing/ZopeTestCase/testPythonScript.py
+6
-4
No files found.
lib/python/Testing/ZopeTestCase/testPythonScript.py
View file @
df62dab6
...
...
@@ -116,26 +116,28 @@ class TestPythonScript(ZopeTestCase.ZopeTestCase):
def
testCannotAccessWithoutAccessPermissionSecurityManager
(
self
):
# manage_main should be protected
self
.
assertRaises
(
Unauthorized
,
getSecurityManager
().
validateValue
,
self
.
ps
.
manage_main
)
self
.
assertRaises
(
Unauthorized
,
getSecurityManager
().
validate
,
self
.
ps
,
self
.
ps
,
'manage_main'
,
self
.
ps
.
manage_main
)
def
testCanAccessWithAccessPermissionSecurityManager
(
self
):
# manage_main should be accessible if we have the necessary permissions
self
.
setPermissions
(
access_permissions
)
try
:
getSecurityManager
().
validate
Value
(
self
.
ps
.
manage_main
)
getSecurityManager
().
validate
(
self
.
ps
,
self
.
ps
,
'manage_main'
,
self
.
ps
.
manage_main
)
except
Unauthorized
:
self
.
fail
(
'Access to manage_main was denied'
)
def
testCannotAccessIfAnonymousSecurityManager
(
self
):
# manage_main should be protected from Anonymous
self
.
logout
()
self
.
assertRaises
(
Unauthorized
,
getSecurityManager
().
validateValue
,
self
.
ps
.
manage_main
)
self
.
assertRaises
(
Unauthorized
,
getSecurityManager
().
validate
,
self
.
ps
,
self
.
ps
,
'manage_main'
,
self
.
ps
.
manage_main
)
def
testCanAccessIfManagerSecurityManager
(
self
):
# manage_main should be accessible to Manager
self
.
setRoles
([
'Manager'
])
try
:
getSecurityManager
().
validate
Value
(
self
.
ps
.
manage_main
)
getSecurityManager
().
validate
(
self
.
ps
,
self
.
ps
,
'manage_main'
,
self
.
ps
.
manage_main
)
except
Unauthorized
:
self
.
fail
(
'Access to manage_main was denied to Manager'
)
...
...
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