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
161aa5a2
Commit
161aa5a2
authored
Feb 15, 2001
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Merge fix for Collector #1975 ('_verifyObjectPaste' uses metatype
permission, if available).
parent
73eabfeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+23
-1
No files found.
lib/python/OFS/CopySupport.py
View file @
161aa5a2
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
#
#
##############################################################################
##############################################################################
__doc__
=
"""Copy interface"""
__doc__
=
"""Copy interface"""
__version__
=
'$Revision: 1.6
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
6
$'
[
11
:
-
2
]
import
sys
,
string
,
Globals
,
Moniker
,
tempfile
,
ExtensionClass
import
sys
,
string
,
Globals
,
Moniker
,
tempfile
,
ExtensionClass
from
marshal
import
loads
,
dumps
from
marshal
import
loads
,
dumps
...
@@ -391,12 +391,34 @@ class CopyContainer(ExtensionClass.Base):
...
@@ -391,12 +391,34 @@ class CopyContainer(ExtensionClass.Base):
action
=
'manage_main'
)
action
=
'manage_main'
)
method_name
=
None
method_name
=
None
mt_permission
=
None
meta_types
=
absattr
(
self
.
all_meta_types
)
meta_types
=
absattr
(
self
.
all_meta_types
)
for
d
in
meta_types
:
for
d
in
meta_types
:
if
d
[
'name'
]
==
mt
:
if
d
[
'name'
]
==
mt
:
method_name
=
d
[
'action'
]
method_name
=
d
[
'action'
]
mt_permission
=
d
.
get
(
'permission'
,
None
)
break
break
if
mt_permission
is
not
None
:
try
:
parent
=
object
.
aq_inner
.
aq_parent
except
:
parent
=
None
if
getSecurityManager
().
checkPermission
(
mt_permission
,
parent
):
if
not
validate_src
:
return
# Ensure the user is allowed to access the object on the
# clipboard.
try
:
parent
=
object
.
aq_inner
.
aq_parent
except
:
parent
=
None
if
getSecurityManager
().
validate
(
None
,
parent
,
None
,
object
):
return
raise
'Unauthorized'
,
absattr
(
object
.
id
)
else
:
raise
'Unauthorized'
,
mt_permission
#
# XXX: Ancient cruft, left here in true co-dependent fashion
# to keep from breaking old products which don't put
# permissions on their metadata registry entries.
#
if
method_name
is
not
None
:
if
method_name
is
not
None
:
meth
=
self
.
unrestrictedTraverse
(
method_name
)
meth
=
self
.
unrestrictedTraverse
(
method_name
)
try
:
parent
=
object
.
aq_inner
.
aq_parent
try
:
parent
=
object
.
aq_inner
.
aq_parent
...
...
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