Commit e6f042d3 authored by Christian Theune's avatar Christian Theune

- Deprecated OFSP.Versions.

parent d13b3c64
......@@ -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).
......
......@@ -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)
......
......@@ -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
......
......@@ -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,
......
<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">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment