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
2aa227f6
Commit
2aa227f6
authored
Sep 21, 1998
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for pasting of "Product" based objects
parent
fbf3b1b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
13 deletions
+29
-13
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+29
-13
No files found.
lib/python/OFS/CopySupport.py
View file @
2aa227f6
__doc__
=
"""Copy interface"""
__doc__
=
"""Copy interface"""
__version__
=
'$Revision: 1.2
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
1
$'
[
11
:
-
2
]
import
sys
,
Globals
,
Moniker
,
tempfile
import
sys
,
string
,
Globals
,
Moniker
,
tempfile
from
marshal
import
loads
,
dumps
from
marshal
import
loads
,
dumps
from
urllib
import
quote
,
unquote
from
urllib
import
quote
,
unquote
from
zlib
import
compress
,
decompress
from
zlib
import
compress
,
decompress
...
@@ -215,19 +215,32 @@ class CopyContainer:
...
@@ -215,19 +215,32 @@ class CopyContainer:
method_name
=
d
[
'action'
]
method_name
=
d
[
'action'
]
break
break
if
method_name
is
not
None
:
if
method_name
is
not
None
:
if
hasattr
(
self
,
method_name
):
if
hasattr
(
self
,
method_name
):
meth
=
getattr
(
self
,
method_name
)
meth
=
getattr
(
self
,
method_name
)
if
hasattr
(
meth
,
'__roles__'
):
else
:
roles
=
meth
.
__roles__
# Handle strange names that come from the Product
user
=
REQUEST
.
get
(
'AUTHENTICATED_USER'
,
None
)
# machinery ;(
__traceback_info__
=
method_name
,
user
mn
=
string
.
split
(
method_name
,
'/'
)
if
(
not
hasattr
(
user
,
'hasRole'
)
or
if
len
(
mn
)
>
1
:
not
user
.
hasRole
(
None
,
roles
)):
pname
=
mn
[
1
]
raise
'Unauthorized'
,
(
product
=
self
.
aq_acquire
(
'_getProducts'
)().
_product
(
pname
)
"""You are not authorized to perform this
fname
=
mn
[
2
]
operation."""
factory
=
getattr
(
product
,
fname
)
)
meth
=
getattr
(
factory
,
factory
.
initial
)
return
if
hasattr
(
meth
,
'__roles__'
):
roles
=
meth
.
__roles__
user
=
REQUEST
.
get
(
'AUTHENTICATED_USER'
,
None
)
__traceback_info__
=
method_name
,
user
if
(
not
hasattr
(
user
,
'hasRole'
)
or
not
user
.
hasRole
(
None
,
roles
)):
raise
'Unauthorized'
,
(
"""You are not authorized to perform this
operation."""
)
return
raise
CopyError
,
MessageDialog
(
raise
CopyError
,
MessageDialog
(
title
=
'Not Supported'
,
title
=
'Not Supported'
,
message
=
'The object <EM>%s</EM> does not support this '
\
message
=
'The object <EM>%s</EM> does not support this '
\
...
@@ -382,6 +395,9 @@ eNotSupported=fMessageDialog(
...
@@ -382,6 +395,9 @@ eNotSupported=fMessageDialog(
##############################################################################
##############################################################################
#
#
# $Log: CopySupport.py,v $
# $Log: CopySupport.py,v $
# Revision 1.21 1998/09/21 20:01:50 brian
# Added support for pasting of "Product" based objects
#
# Revision 1.20 1998/08/26 18:33:44 brian
# Revision 1.20 1998/08/26 18:33:44 brian
# Updated permissions in Folder folder for the copy/paste methods and added
# Updated permissions in Folder folder for the copy/paste methods and added
# cvs log to Folder.py
# cvs log to Folder.py
...
...
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