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
a85ff53f
Commit
a85ff53f
authored
Oct 08, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use allowed() instead of deprecated hasRole(), and enable proxy roles
by passing self in.
parent
2c206751
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+6
-12
No files found.
lib/python/Products/PythonScripts/PythonScript.py
View file @
a85ff53f
...
...
@@ -89,7 +89,7 @@ This product provides support for Script objects containing restricted
Python code.
"""
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
import
sys
,
os
,
traceback
,
re
,
marshal
from
Globals
import
DTMLFile
,
MessageDialog
,
package_home
...
...
@@ -371,20 +371,14 @@ class PythonScript(Script, Historical, Cacheable):
def
manage_haveProxy
(
self
,
r
):
return
r
in
self
.
_proxy_roles
def
_validateProxy
(
self
,
roles
=
None
):
if
roles
is
None
:
roles
=
self
.
_proxy_roles
if
roles
is
None
:
roles
=
self
.
_proxy_roles
if
not
roles
:
return
user
=
u
=
getSecurityManager
().
getUser
()
if
user
is
not
None
:
user
=
user
.
hasRole
for
r
in
roles
:
if
r
and
not
user
(
None
,
(
r
,)):
user
=
None
break
if
user
is
not
None
:
return
user
=
getSecurityManager
().
getUser
()
if
user
is
not
None
and
user
.
allowed
(
self
,
roles
):
return
raise
'Forbidden'
,
(
'You are not authorized to change <em>%s</em> '
'because you do not have proxy roles.
\
n
<!--%s, %s-->'
%
(
self
.
id
,
u
,
roles
))
%
(
self
.
id
,
u
ser
,
roles
))
security
.
declareProtected
(
'Change proxy roles'
,
'manage_proxyForm'
,
'manage_proxy'
)
...
...
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