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
6ee52c75
Commit
6ee52c75
authored
Aug 08, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added access control support
parent
2a497d58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
13 deletions
+32
-13
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+6
-2
lib/python/OFS/Document.py
lib/python/OFS/Document.py
+14
-6
lib/python/OFS/Folder.py
lib/python/OFS/Folder.py
+6
-5
lib/python/OFS/documentAdd.dtml
lib/python/OFS/documentAdd.dtml
+6
-0
No files found.
lib/python/OFS/Application.py
View file @
6ee52c75
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
__doc__
=
'''Application support
__doc__
=
'''Application support
$Id: Application.py,v 1.
3 1997/08/06 18:26:12
jim Exp $'''
$Id: Application.py,v 1.
4 1997/08/08 15:51:27
jim Exp $'''
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
import
Folder
,
regex
,
string
import
Folder
,
regex
,
string
import
Globals
import
Globals
...
@@ -20,6 +20,7 @@ import Globals
...
@@ -20,6 +20,7 @@ import Globals
class
Application
(
Folder
.
Folder
):
class
Application
(
Folder
.
Folder
):
id
=
'Your Place'
id
=
'Your Place'
__roles__
=
None
title
=
''
title
=
''
web__form__method
=
'GET'
web__form__method
=
'GET'
manage_options
=
Folder
.
Folder
.
manage_options
+
(
manage_options
=
Folder
.
Folder
.
manage_options
+
(
...
@@ -112,6 +113,9 @@ if __name__ == "__main__": main()
...
@@ -112,6 +113,9 @@ if __name__ == "__main__": main()
##############################################################################
##############################################################################
#
#
# $Log: Application.py,v $
# $Log: Application.py,v $
# Revision 1.4 1997/08/08 15:51:27 jim
# Added access control support
#
# Revision 1.3 1997/08/06 18:26:12 jim
# Revision 1.3 1997/08/06 18:26:12 jim
# Renamed description->title and name->id and other changes
# Renamed description->title and name->id and other changes
#
#
...
...
lib/python/OFS/Document.py
View file @
6ee52c75
"""Document object"""
"""Document object"""
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
from
STPDocumentTemplate
import
HTML
from
STPDocumentTemplate
import
HTML
from
Globals
import
shared_dt_globals
,
HTMLFile
from
Globals
import
shared_dt_globals
,
HTMLFile
from
string
import
join
,
split
,
strip
import
AccessControl.ACL
class
Document
(
HTML
):
class
Document
(
HTML
):
"""A Document object"""
"""A Document object"""
...
@@ -11,18 +13,23 @@ class Document(HTML):
...
@@ -11,18 +13,23 @@ class Document(HTML):
title
=
''
title
=
''
icon
=
'OFS/Document_icon.gif'
icon
=
'OFS/Document_icon.gif'
__state_names__
=
HTML
.
__state_names__
+
(
'title'
,)
__state_names__
=
HTML
.
__state_names__
+
(
'title'
,
'__roles__'
)
shared_globals
=
shared_dt_globals
shared_globals
=
shared_dt_globals
manage_edit__allow_groups__
=
None
manage_edit__allow_groups__
=
{
None
:
None
}
def
document_template_form_header
(
self
):
def
document_template_form_header
(
self
):
try
:
roles
=
join
(
self
.
__roles__
)
except
:
roles
=
''
return
(
"""<br>Title:
return
(
"""<br>Title:
<input type=text name=title SIZE="50" value="%s">
<input type=text name=title SIZE="50" value="%s">
<P>"""
%
self
.
title
)
<br>Roles:
<input type=text name=roles SIZE="50" value="%s">
<P>"""
%
(
self
.
title
,
roles
))
def
manage_edit
(
self
,
data
,
title
,
REQUEST
=
None
):
def
manage_edit
(
self
,
data
,
title
,
roles
,
REQUEST
=
None
):
"""Edit method"""
"""Edit method"""
self
.
title
=
title
self
.
title
=
title
AccessControl
.
ACL
.
parse_roles_string
(
self
,
roles
)
return
HTML
.
manage_edit
(
self
,
data
,
REQUEST
)
return
HTML
.
manage_edit
(
self
,
data
,
REQUEST
)
...
@@ -44,11 +51,12 @@ class DocumentHandler:
...
@@ -44,11 +51,12 @@ class DocumentHandler:
manage_addDocumentForm
=
HTMLFile
(
'OFS/documentAdd'
)
manage_addDocumentForm
=
HTMLFile
(
'OFS/documentAdd'
)
def
manage_addDocument
(
self
,
id
,
title
,
REQUEST
,
file
=
''
):
def
manage_addDocument
(
self
,
id
,
title
,
roles
,
REQUEST
,
file
=
''
):
"""Add a new Document object"""
"""Add a new Document object"""
if
not
file
:
file
=
default_html
if
not
file
:
file
=
default_html
i
=
Document
(
file
,
__name__
=
id
)
i
=
Document
(
file
,
__name__
=
id
)
i
.
title
=
title
i
.
title
=
title
AccessControl
.
ACL
.
parse_roles_string
(
i
,
roles
)
self
.
_setObject
(
id
,
i
)
self
.
_setObject
(
id
,
i
)
return
self
.
manage_main
(
self
,
REQUEST
)
return
self
.
manage_main
(
self
,
REQUEST
)
...
...
lib/python/OFS/Folder.py
View file @
6ee52c75
"""Folder object
"""Folder object
$Id: Folder.py,v 1.
3 1997/08/08 13:40:01
jim Exp $"""
$Id: Folder.py,v 1.
4 1997/08/08 15:51:28
jim Exp $"""
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
from
Globals
import
HTMLFile
from
Globals
import
HTMLFile
...
@@ -20,6 +20,9 @@ class FolderHandler:
...
@@ -20,6 +20,9 @@ class FolderHandler:
manage_addFolderForm
=
HTMLFile
(
'OFS/folderAdd'
)
manage_addFolderForm
=
HTMLFile
(
'OFS/folderAdd'
)
def
__init__
(
self
):
self
.
__allow_groups__
=
self
.
AccessControlLists
=
ACL
()
def
folderClass
(
self
):
def
folderClass
(
self
):
return
Folder
return
Folder
return
self
.
__class__
return
self
.
__class__
...
@@ -75,13 +78,11 @@ class Folder(ObjectManager,DocumentHandler,ImageHandler,FolderHandler):
...
@@ -75,13 +78,11 @@ class Folder(ObjectManager,DocumentHandler,ImageHandler,FolderHandler):
{
'icon'
:
'OFS/properties.jpg'
,
'label'
:
'Properties'
,
{
'icon'
:
'OFS/properties.jpg'
,
'label'
:
'Properties'
,
'action'
:
'manage_propertiesForm'
,
'target'
:
'manage_main'
},
'action'
:
'manage_propertiesForm'
,
'target'
:
'manage_main'
},
{
'icon'
:
'AccessControl/AccessControl_icon.gif'
,
'label'
:
'Access Control'
,
{
'icon'
:
'AccessControl/AccessControl_icon.gif'
,
'label'
:
'Access Control'
,
'action'
:
'A
CL
/manage_main'
,
'target'
:
'manage_main'
},
'action'
:
'A
ccessControlLists
/manage_main'
,
'target'
:
'manage_main'
},
{
'icon'
:
'App/help.jpg'
,
'label'
:
'Help'
,
{
'icon'
:
'App/help.jpg'
,
'label'
:
'Help'
,
'action'
:
'manage_help'
,
'target'
:
'_new'
},
'action'
:
'manage_help'
,
'target'
:
'_new'
},
)
)
ACL
=
ACL
()
...
...
lib/python/OFS/documentAdd.dtml
View file @
6ee52c75
...
@@ -22,6 +22,12 @@
...
@@ -22,6 +22,12 @@
<INPUT TYPE="TEXT" NAME="title" SIZE="50">
<INPUT TYPE="TEXT" NAME="title" SIZE="50">
</TD>
</TD>
</TR>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP"><B>Roles of authorized users</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="roles" SIZE="50">
</TD>
</TR>
<TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP"><B>File</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP"><B>File</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT" VALIGN="TOP">
...
...
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