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
d358ecb0
Commit
d358ecb0
authored
Mar 09, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added DAV security settings
parent
ea880556
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
40 deletions
+47
-40
lib/python/OFS/DTMLDocument.py
lib/python/OFS/DTMLDocument.py
+13
-10
lib/python/OFS/DTMLMethod.py
lib/python/OFS/DTMLMethod.py
+13
-9
lib/python/OFS/Folder.py
lib/python/OFS/Folder.py
+10
-7
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+11
-14
No files found.
lib/python/OFS/DTMLDocument.py
View file @
d358ecb0
...
...
@@ -102,7 +102,7 @@
##############################################################################
"""DTML Document objects."""
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
10
$'
[
11
:
-
2
]
from
DocumentTemplate.DT_Util
import
InstanceDict
,
TemplateDict
from
ZPublisher.Converters
import
type_converters
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
...
...
@@ -130,15 +130,18 @@ class DTMLDocument(DTMLMethod, PropertyManager):
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage'
,
'manage_main'
,
'manage_editForm'
,
'manage_tabs'
,
'manage_uploadForm'
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Change DTML Documents'
,
[
'manage_edit'
,
'manage_upload'
,
'PUT'
]),
(
'Change proxy roles'
,
[
'manage_proxyForm'
,
'manage_proxy'
]),
(
'Manage properties'
,
[
'manage_addProperty'
,
'manage_editProperties'
,
'manage_delProperties'
,
'manage_changeProperties'
]),
(
'View'
,
[
'__call__'
,
''
]),
(
'FTP access'
,
[
'manage_FTPstat'
,
'manage_FTPget'
,
'manage_FTPlist'
]),
(
'View management screens'
,
(
'manage'
,
'manage_main'
,
'manage_editForm'
,
'manage_tabs'
,
'manage_uploadForm'
)),
(
'Access contents information'
,
(
'PROPFIND'
,)),
(
'Change permissions'
,
(
'manage_access'
,)),
(
'Change DTML Documents'
,
(
'manage_edit'
,
'manage_upload'
,
'PUT'
)),
(
'Change proxy roles'
,
(
'manage_proxyForm'
,
'manage_proxy'
)),
(
'Manage properties'
,
(
'manage_addProperty'
,
'manage_editProperties'
,
'manage_delProperties'
,
'manage_changeProperties'
,
'PROPPATCH'
)),
(
'View'
,
(
'__call__'
,
'HEAD'
,
''
)),
(
'FTP access'
,
(
'manage_FTPstat'
,
'manage_FTPget'
,
'manage_FTPlist'
)),
(
'Delete objects'
,
(
'DELETE'
,)),
)
def
__getstate__
(
self
):
...
...
lib/python/OFS/DTMLMethod.py
View file @
d358ecb0
...
...
@@ -102,7 +102,7 @@
##############################################################################
"""DTML Method objects."""
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
,
lower
...
...
@@ -135,12 +135,15 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage'
,
'manage_main'
,
'manage_editForm'
,
'manage_tabs'
,
'manage_uploadForm'
]),
(
'Change DTML Methods'
,
[
'manage_edit'
,
'manage_upload'
,
'PUT'
]),
(
'Change proxy roles'
,
[
'manage_proxyForm'
,
'manage_proxy'
]),
(
'View'
,
[
'__call__'
,
''
]),
(
'FTP access'
,
[
'manage_FTPstat'
,
'manage_FTPget'
,
'manage_FTPlist'
]),
(
'View management screens'
,
(
'manage'
,
'manage_main'
,
'manage_editForm'
,
'manage_tabs'
,
'manage_uploadForm'
)),
(
'Access contents information'
,
(
'PROPFIND'
,)),
(
'Change DTML Methods'
,
(
'manage_edit'
,
'manage_upload'
,
'PUT'
)),
(
'Change proxy roles'
,
(
'manage_proxyForm'
,
'manage_proxy'
)),
(
'View'
,
(
'__call__'
,
'HEAD'
,
''
)),
(
'FTP access'
,
(
'manage_FTPstat'
,
'manage_FTPget'
,
'manage_FTPlist'
)),
(
'Manage properties'
,
(
'PROPPATCH'
,)),
(
'Delete objects'
,
(
'DELETE'
,)),
)
_state_name
=
{
'raw'
:
1
,
'globals'
:
1
,
'__name__'
:
1
,
'_vars'
:
1
,
'_proxy_roles'
:
1
,
'title'
:
1
}.
has_key
...
...
@@ -177,7 +180,8 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
def
get_size
(
self
):
return
len
(
self
.
raw
)
getSize
=
get_size
def
oldvalidate
(
self
,
inst
,
parent
,
name
,
value
,
md
):
if
hasattr
(
value
,
'__roles__'
):
roles
=
value
.
__roles__
...
...
@@ -310,7 +314,7 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
def
PUT
(
self
,
REQUEST
,
RESPONSE
):
"""Handle HTTP PUT requests."""
self
.
init_headers
(
RESPONSE
)
self
.
dav__init
(
REQUEST
,
RESPONSE
)
body
=
REQUEST
.
get
(
'BODY'
,
''
)
self
.
_validateProxy
(
REQUEST
)
self
.
munge
(
body
)
...
...
lib/python/OFS/Folder.py
View file @
d358ecb0
...
...
@@ -105,9 +105,9 @@
Folders are the basic container objects and are analogous to directories.
$Id: Folder.py,v 1.6
7 1999/03/04 17:44:51
brian Exp $"""
$Id: Folder.py,v 1.6
8 1999/03/09 17:06:52
brian Exp $"""
__version__
=
'$Revision: 1.6
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
8
$'
[
11
:
-
2
]
import
Globals
,
SimpleItem
,
Acquisition
,
mimetypes
,
content_types
from
Globals
import
HTMLFile
...
...
@@ -171,7 +171,7 @@ class Folder(ObjectManager, PropertyManager, RoleManager, Collection,
)
__ac_permissions__
=
(
(
'View'
,
()),
(
'View'
,
(
'HEAD'
,
)),
(
'View management screens'
,
(
'manage'
,
'manage_menu'
,
'manage_main'
,
'manage_copyright'
,
'manage_tabs'
,
'manage_propertiesForm'
,
'manage_UndoForm'
,
...
...
@@ -181,7 +181,8 @@ class Folder(ObjectManager, PropertyManager, RoleManager, Collection,
'manage_findResult'
)),
(
'Access contents information'
,
(
'objectIds'
,
'objectValues'
,
'objectItems'
,
'hasProperty'
,
'propertyIds'
,
'propertyValues'
,
'propertyItems'
,
''
),
'propertyIds'
,
'propertyValues'
,
'propertyItems'
,
'PROPFIND'
,
''
),
(
'Anonymous'
,
'Manager'
),
),
(
'Undo changes'
,
(
'manage_undo_transactions'
,)),
...
...
@@ -194,7 +195,8 @@ class Folder(ObjectManager, PropertyManager, RoleManager, Collection,
(
'Delete objects'
,
(
'manage_delObjects'
,
'DELETE'
)),
(
'Manage properties'
,
(
'manage_addProperty'
,
'manage_editProperties'
,
'manage_delProperties'
,
'manage_changeProperties'
,)),
'manage_delProperties'
,
'manage_changeProperties'
,
'PROPPATCH'
)),
(
'FTP access'
,
(
'manage_FTPstat'
,
'manage_FTPlist'
)),
(
'Import/Export objects'
,
(
'manage_importObject'
,
'manage_importExportForm'
,
...
...
@@ -223,9 +225,10 @@ class Folder(ObjectManager, PropertyManager, RoleManager, Collection,
def
__getitem__
(
self
,
key
):
if
hasattr
(
self
,
'REQUEST'
):
method
=
self
.
REQUEST
.
get
(
'REQUEST_METHOD'
,
'GET'
)
request
=
self
.
REQUEST
method
=
request
.
get
(
'REQUEST_METHOD'
,
'GET'
)
if
not
method
in
(
'GET'
,
'POST'
):
return
NullResource
(
self
,
key
).
__of__
(
self
)
return
NullResource
(
self
,
key
,
request
).
__of__
(
self
)
raise
KeyError
,
key
def
folderClass
(
self
):
...
...
lib/python/OFS/Image.py
View file @
d358ecb0
...
...
@@ -102,7 +102,7 @@
##############################################################################
"""Image object"""
__version__
=
'$Revision: 1.5
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
7
$'
[
11
:
-
2
]
import
Globals
,
string
,
struct
,
mimetypes
,
content_types
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -145,16 +145,19 @@ class File(Persistent,Implicit,PropertyManager,
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage'
,
'manage_tabs'
,
'manage_uploadForm'
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Change Images and Files'
,
[
'manage_edit'
,
'manage_upload'
,
'PUT'
]),
(
'View'
,
[
'index_html'
,
'view_image_or_file'
,
'getSize'
,
'getContentType'
,
''
]),
(
'View management screens'
,
(
'manage'
,
'manage_tabs'
,
'manage_uploadForm'
)),
(
'Access contents information'
,
(
'PROPFIND'
,)),
(
'Change permissions'
,
(
'manage_access'
,)),
(
'Change Images and Files'
,
(
'manage_edit'
,
'manage_upload'
,
'PUT'
)),
(
'View'
,
(
'index_html'
,
'view_image_or_file'
,
'getSize'
,
'getContentType'
,
'HEAD'
,
''
)),
(
'Manage properties'
,
(
'manage_addProperty'
,
'manage_editProperties'
,
'manage_delProperties'
,
'manage_changeProperties'
,)),
'manage_changeProperties'
,
'PROPPATCH'
)),
(
'FTP access'
,
(
'manage_FTPstat'
,
'manage_FTPget'
,
'manage_FTPlist'
)),
(
'Delete objects'
,
(
'DELETE'
,)),
)
...
...
@@ -253,15 +256,9 @@ class File(Persistent,Implicit,PropertyManager,
message
=
'Your changes have been saved'
,
action
=
'manage_main'
)
HEAD__roles__
=
None
def
HEAD
(
self
,
REQUEST
,
RESPONSE
):
""" """
RESPONSE
[
'content-type'
]
=
self
.
content_type
RESPONSE
[
'content-length'
]
=
self
.
getSize
()
return
''
def
PUT
(
self
,
REQUEST
,
RESPONSE
):
"""Handle HTTP PUT requests"""
self
.
dav__init
(
REQUEST
,
RESPONSE
)
type
=
REQUEST
.
get_header
(
'content-type'
,
None
)
body
=
REQUEST
.
get
(
'BODY'
,
''
)
if
type
is
None
:
...
...
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