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
e6f042d3
Commit
e6f042d3
authored
Nov 26, 2004
by
Christian Theune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Deprecated OFSP.Versions.
parent
d13b3c64
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
12 deletions
+41
-12
doc/CHANGES.txt
doc/CHANGES.txt
+4
-0
lib/python/AccessControl/Role.py
lib/python/AccessControl/Role.py
+12
-6
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+8
-0
lib/python/Products/OFSP/__init__.py
lib/python/Products/OFSP/__init__.py
+15
-6
lib/python/Products/OFSP/dtml/version.dtml
lib/python/Products/OFSP/dtml/version.dtml
+2
-0
No files found.
doc/CHANGES.txt
View file @
e6f042d3
...
...
@@ -46,6 +46,10 @@ Zope Changes
Bugs fixed
- Removed Version objects from the add menu. Versions are agreed to be a
feature that should not be used as it is not well implemented and
allows for data loss.
- Collector #1510: Allow encoding of application/xhtml+xml pages
according to the charset specified in the Content-Type header
(thanks to Jacek Konieczny for the patch).
...
...
lib/python/AccessControl/Role.py
View file @
e6f042d3
...
...
@@ -341,13 +341,15 @@ class RoleManager(ExtensionClass.Base, PermissionMapping.RoleManager):
"""Set local roles for a user."""
if
not
roles
:
raise
ValueError
,
'One or more roles must be given!'
dict
=
self
.
__ac_local_roles__
or
{}
dict
=
self
.
__ac_local_roles__
if
dict
is
None
:
self
.
__ac_local_roles__
=
dict
=
{}
local_roles
=
list
(
dict
.
get
(
userid
,
[]))
for
r
in
roles
:
if
r
not
in
local_roles
:
local_roles
.
append
(
r
)
dict
[
userid
]
=
local_roles
self
.
_
_ac_local_roles__
=
dict
self
.
_
p_changed
=
True
if
REQUEST
is
not
None
:
stat
=
'Your changes have been saved.'
return
self
.
manage_listLocalRoles
(
self
,
REQUEST
,
stat
=
stat
)
...
...
@@ -356,20 +358,24 @@ class RoleManager(ExtensionClass.Base, PermissionMapping.RoleManager):
"""Set local roles for a user."""
if
not
roles
:
raise
ValueError
,
'One or more roles must be given!'
dict
=
self
.
__ac_local_roles__
or
{}
dict
=
self
.
__ac_local_roles__
if
dict
is
None
:
self
.
__ac_local_roles__
=
dict
=
{}
dict
[
userid
]
=
roles
self
.
_
_ac_local_roles__
=
dict
self
.
_
p_changed
=
True
if
REQUEST
is
not
None
:
stat
=
'Your changes have been saved.'
return
self
.
manage_listLocalRoles
(
self
,
REQUEST
,
stat
=
stat
)
def
manage_delLocalRoles
(
self
,
userids
,
REQUEST
=
None
):
"""Remove all local roles for a user."""
dict
=
self
.
__ac_local_roles__
or
{}
dict
=
self
.
__ac_local_roles__
if
dict
is
None
:
self
.
__ac_local_roles__
=
dict
=
{}
for
userid
in
userids
:
if
dict
.
has_key
(
userid
):
del
dict
[
userid
]
self
.
_
_ac_local_roles__
=
dict
self
.
_
p_changed
=
True
if
REQUEST
is
not
None
:
stat
=
'Your changes have been saved.'
return
self
.
manage_listLocalRoles
(
self
,
REQUEST
,
stat
=
stat
)
...
...
lib/python/Products/OFSP/Version.py
View file @
e6f042d3
...
...
@@ -88,6 +88,14 @@ class Version(Persistent,Implicit,RoleManager,Item):
return
r
def
om_icons
(
self
):
"""Return a list of icon URLs to be displayed by an ObjectManager"""
return
({
'path'
:
'misc_/OFSP/version.gif'
,
'alt'
:
self
.
meta_type
,
'title'
:
self
.
meta_type
},
{
'path'
:
'misc_/PageTemplates/exclamation.gif'
,
'alt'
:
'Deprecated object'
,
'title'
:
'Version objects are deprecated and should not be used anyore.'
},)
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
""" """
self
.
title
=
title
...
...
lib/python/Products/OFSP/__init__.py
View file @
e6f042d3
...
...
@@ -22,6 +22,7 @@ import ZClasses.ObjectManager
from
AccessControl.Permissions
import
add_documents_images_and_files
from
AccessControl.Permissions
import
add_folders
from
ZClasses
import
createZClassForBase
from
ImageFile
import
ImageFile
createZClassForBase
(
OFS
.
DTMLMethod
.
DTMLMethod
,
globals
()
,
'ZDTMLMethod'
,
'DTML Method'
)
...
...
@@ -39,6 +40,10 @@ createZClassForBase( AccessControl.User.UserFolder, globals()
createZClassForBase
(
AccessControl
.
User
.
User
,
globals
()
,
'ZUser'
,
'User'
)
misc_
=
{
'version.gif'
:
ImageFile
(
'images/version.gif'
,
globals
())
}
# This is the new way to initialize products. It is hoped
# that this more direct mechanism will be more understandable.
def
initialize
(
context
):
...
...
@@ -105,13 +110,17 @@ def initialize(context):
legacy
=
(
AccessControl
.
User
.
manage_addUserFolder
,),
)
## Those both classes are relicts. We only withdraw them from the Add menu.
## This way people will stop using them. They are undocumented anyway.
## People also have the chance to softly migrate their data and stop using the
## versions they still use.
context
.
registerClass
(
Version
.
Version
,
constructors
=
(
Version
.
manage_addVersionForm
,
Version
.
manage_addVersion
),
icon
=
'images/version.gif'
)
#
context.registerClass(
#
Version.Version,
#
constructors=(Version.manage_addVersionForm,
#
Version.manage_addVersion),
#
icon='images/version.gif'
#
)
#context.registerClass(
# Draft.Draft,
...
...
lib/python/Products/OFSP/dtml/version.dtml
View file @
e6f042d3
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<h3 style="color:red;">Version objects are deprecated and should not be used anymore!</h3>
<dtml-if Zope-Version>
<dtml-if expr="_vars['Zope-Version'] != cookie">
...
...
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