[CMF-checkins] CVS: CMF/CMFTopic - permissions.py:1.2
AbstractCriterion.py:1.8 DateCriteria.py:1.10
ListCriterion.py:1.14 SimpleIntCriterion.py:1.13
SimpleStringCriterion.py:1.11 SortCriterion.py:1.7
Topic.py:1.41 TopicPermissions.py:1.6 __init__.py:1.14
Tres Seaver
tseaver at zope.com
Thu Apr 29 12:13:53 EDT 2004
Update of /cvs-repository/CMF/CMFTopic
In directory cvs.zope.org:/tmp/cvs-serv25166/CMFTopic
Modified Files:
AbstractCriterion.py DateCriteria.py ListCriterion.py
SimpleIntCriterion.py SimpleStringCriterion.py
SortCriterion.py Topic.py TopicPermissions.py __init__.py
Added Files:
permissions.py
Log Message:
- Merge tseaver-permissiongeddon-branch.
=== CMF/CMFTopic/permissions.py 1.1 => 1.2 ===
--- /dev/null Thu Apr 29 12:13:53 2004
+++ CMF/CMFTopic/permissions.py Thu Apr 29 12:13:22 2004
@@ -0,0 +1,38 @@
+##############################################################################
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
+""" Permissions used throughout CMFTopic.
+
+$Id$
+"""
+from AccessControl import ModuleSecurityInfo
+
+security = ModuleSecurityInfo('Products.CMFTopic.permissions')
+
+from Products.CMFCore.permissions import setDefaultRoles
+
+security.declarePublic('AddTopics')
+AddTopics = 'Add portal topics'
+setDefaultRoles(AddTopics, ('Manager',))
+
+security.declarePublic('ChangeTopics')
+ChangeTopics = 'Change portal topics'
+setDefaultRoles(ChangeTopics, ('Manager', 'Owner',))
+
+security.declarePublic('AccessContentsInformation')
+from Products.CMFCore.permissions import AccessContentsInformation
+
+security.declarePublic('ListFolderContents')
+from Products.CMFCore.permissions import ListFolderContents
+
+security.declarePublic('View')
+from Products.CMFCore.permissions import View
=== CMF/CMFTopic/AbstractCriterion.py 1.7 => 1.8 ===
--- CMF/CMFTopic/AbstractCriterion.py:1.7 Mon Dec 1 08:55:45 2003
+++ CMF/CMFTopic/AbstractCriterion.py Thu Apr 29 12:13:22 2004
@@ -14,16 +14,14 @@
$Id$
"""
-
-from Products.CMFTopic.TopicPermissions import ChangeTopics
-
-from Products.CMFCore.CMFCorePermissions import AccessContentsInformation
-
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Persistence import Persistent
from Globals import InitializeClass
from OFS.SimpleItem import Item
+
+from permissions import AccessContentsInformation
+from permissions import ChangeTopics
class AbstractCriterion( Persistent, Item, Implicit ):
=== CMF/CMFTopic/DateCriteria.py 1.9 => 1.10 ===
--- CMF/CMFTopic/DateCriteria.py:1.9 Thu Feb 19 10:59:04 2004
+++ CMF/CMFTopic/DateCriteria.py Thu Apr 29 12:13:22 2004
@@ -19,12 +19,11 @@
from DateTime.DateTime import DateTime
from Globals import InitializeClass
-from Products.CMFCore.CMFCorePermissions import View
-
-from Products.CMFTopic import TopicPermissions
-from Products.CMFTopic.AbstractCriterion import AbstractCriterion
-from Products.CMFTopic.interfaces import Criterion
-from Products.CMFTopic.Topic import Topic
+from permissions import View
+from permissions import ChangeTopics
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion
+from Topic import Topic
class FriendlyDateCriterion( AbstractCriterion ):
@@ -68,7 +67,7 @@
"""
return self._defaultDateOptions
- security.declareProtected( TopicPermissions.ChangeTopics, 'getEditForm' )
+ security.declareProtected( ChangeTopics, 'getEditForm' )
def getEditForm( self ):
"""
Return the name of the skin method used by Topic to edit
@@ -76,7 +75,7 @@
"""
return 'friendlydatec_editform'
- security.declareProtected( TopicPermissions.ChangeTopics, 'edit' )
+ security.declareProtected( ChangeTopics, 'edit' )
def edit( self
, value=None
, operation='min'
=== CMF/CMFTopic/ListCriterion.py 1.13 => 1.14 ===
--- CMF/CMFTopic/ListCriterion.py:1.13 Mon Dec 1 08:55:45 2003
+++ CMF/CMFTopic/ListCriterion.py Thu Apr 29 12:13:22 2004
@@ -14,18 +14,17 @@
$Id$
"""
-
-from Products.CMFTopic.AbstractCriterion import AbstractCriterion
-from Products.CMFTopic.interfaces import Criterion
-from Products.CMFTopic.Topic import Topic
-from Products.CMFTopic import TopicPermissions
-
-from Products.CMFCore.CMFCorePermissions import View
-
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
+from permissions import View
+from permissions import ChangeTopics
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion
+from Topic import Topic
+
+
class ListCriterion( AbstractCriterion ):
"""
Represent a criterion which is a list of values (for an
@@ -54,7 +53,7 @@
self.value = ( '', ) # *Not* '()', which won't do at all!
self.operator = None
- security.declareProtected( TopicPermissions.ChangeTopics, 'getEditForm' )
+ security.declareProtected( ChangeTopics, 'getEditForm' )
def getEditForm( self ):
"""
Return the name of skin method which renders the form
@@ -62,7 +61,7 @@
"""
return "listc_edit"
- security.declareProtected( TopicPermissions.ChangeTopics, 'edit' )
+ security.declareProtected( ChangeTopics, 'edit' )
def edit( self, value=None, operator=None ):
"""
Update the value we match against.
=== CMF/CMFTopic/SimpleIntCriterion.py 1.12 => 1.13 ===
--- CMF/CMFTopic/SimpleIntCriterion.py:1.12 Thu Feb 19 10:59:04 2004
+++ CMF/CMFTopic/SimpleIntCriterion.py Thu Apr 29 12:13:22 2004
@@ -18,12 +18,11 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
-from Products.CMFCore.CMFCorePermissions import View
-
-from Products.CMFTopic import TopicPermissions
-from Products.CMFTopic.AbstractCriterion import AbstractCriterion
-from Products.CMFTopic.interfaces import Criterion
-from Products.CMFTopic.Topic import Topic
+from permissions import View
+from permissions import ChangeTopics
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion
+from Topic import Topic
class SimpleIntCriterion( AbstractCriterion ):
@@ -47,7 +46,7 @@
self.field = field
self.value = self.direction = None
- security.declareProtected( TopicPermissions.ChangeTopics, 'getEditForm' )
+ security.declareProtected( ChangeTopics, 'getEditForm' )
def getEditForm( self ):
"""
Return the name of skin method which renders the form
@@ -55,7 +54,7 @@
"""
return 'sic_edit'
- security.declareProtected( TopicPermissions.ChangeTopics, 'getValueString' )
+ security.declareProtected( ChangeTopics, 'getValueString' )
def getValueString( self ):
"""
Return a string representation of the value for which this
@@ -75,7 +74,7 @@
return str( self.value )
- security.declareProtected( TopicPermissions.ChangeTopics, 'edit' )
+ security.declareProtected( ChangeTopics, 'edit' )
def edit( self, value, direction=None ):
"""
Update the value to be filtered, and the "direction" qualifier.
=== CMF/CMFTopic/SimpleStringCriterion.py 1.10 => 1.11 ===
--- CMF/CMFTopic/SimpleStringCriterion.py:1.10 Sat Aug 3 22:31:31 2002
+++ CMF/CMFTopic/SimpleStringCriterion.py Thu Apr 29 12:13:22 2004
@@ -14,17 +14,15 @@
$Id$
"""
-
-from Products.CMFTopic import TopicPermissions
-from Products.CMFTopic.AbstractCriterion import AbstractCriterion
-from Products.CMFTopic.Topic import Topic
-from Products.CMFTopic.interfaces import Criterion
-
-from Products.CMFCore.CMFCorePermissions import View
-
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
+from permissions import View
+from permissions import ChangeTopics
+from AbstractCriterion import AbstractCriterion
+from Topic import Topic
+from interfaces import Criterion
+
class SimpleStringCriterion( AbstractCriterion ):
"""
Represent a simple field-match for a string value.
@@ -42,14 +40,14 @@
self.field = field
self.value = ''
- security.declareProtected( TopicPermissions.ChangeTopics, 'getEditForm' )
+ security.declareProtected( ChangeTopics, 'getEditForm' )
def getEditForm( self ):
"""
Return the skinned name of the edit form.
"""
return 'ssc_edit'
- security.declareProtected( TopicPermissions.ChangeTopics, 'edit' )
+ security.declareProtected( ChangeTopics, 'edit' )
def edit( self, value ):
"""
Update the value we are to match up against.
=== CMF/CMFTopic/SortCriterion.py 1.6 => 1.7 ===
--- CMF/CMFTopic/SortCriterion.py:1.6 Sat Aug 3 22:31:31 2002
+++ CMF/CMFTopic/SortCriterion.py Thu Apr 29 12:13:22 2004
@@ -14,17 +14,15 @@
$Id$
"""
-
-from Products.CMFTopic.AbstractCriterion import AbstractCriterion
-from Products.CMFTopic.Topic import Topic
-from Products.CMFTopic.interfaces import Criterion
-from Products.CMFTopic import TopicPermissions
-
-from Products.CMFCore.CMFCorePermissions import View
-
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
+from permissions import View
+from permissions import ChangeTopics
+from AbstractCriterion import AbstractCriterion
+from Topic import Topic
+from interfaces import Criterion
+
class SortCriterion( AbstractCriterion ):
"""
Represent a mock criterion, to allow spelling the sort order
@@ -52,7 +50,7 @@
"""
return self.index
- security.declareProtected( TopicPermissions.ChangeTopics, 'getEditForm' )
+ security.declareProtected( ChangeTopics, 'getEditForm' )
def getEditForm( self ):
"""
Return the name of skin method which renders the form
@@ -60,7 +58,7 @@
"""
return 'sort_edit'
- security.declareProtected( TopicPermissions.ChangeTopics, 'edit' )
+ security.declareProtected( ChangeTopics, 'edit' )
def edit( self, reversed ):
"""
Update the value we are to match up against.
=== CMF/CMFTopic/Topic.py 1.40 => 1.41 ===
--- CMF/CMFTopic/Topic.py:1.40 Mon Feb 23 07:55:05 2004
+++ CMF/CMFTopic/Topic.py Thu Apr 29 12:13:22 2004
@@ -19,14 +19,14 @@
from Acquisition import aq_parent, aq_inner, aq_base
from Globals import InitializeClass
-from Products.CMFCore.CMFCorePermissions import ListFolderContents
-from Products.CMFCore.CMFCorePermissions import View
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.utils import _getViewFor
from Products.CMFCore.utils import getToolByName
-from Products.CMFTopic.TopicPermissions import AddTopics
-from Products.CMFTopic.TopicPermissions import ChangeTopics
+from permissions import ListFolderContents
+from permissions import View
+from permissions import AddTopics
+from permissions import ChangeTopics
# Factory type information -- makes Topic objects play nicely
=== CMF/CMFTopic/TopicPermissions.py 1.5 => 1.6 ===
--- CMF/CMFTopic/TopicPermissions.py:1.5 Thu Aug 1 15:05:13 2002
+++ CMF/CMFTopic/TopicPermissions.py Thu Apr 29 12:13:22 2004
@@ -10,18 +10,15 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
-""" TopicPermissions: Permissions used throughout CMFTopic.
+""" Backward-compatibility module for CMFTopic product permissions.
$Id$
"""
-from Products.CMFCore.CMFCorePermissions import setDefaultRoles
+from permissions import *
-# Gathering Topic Related Permissions into one place
-AddTopics = 'Add portal topics'
-ChangeTopics = 'Change portal topics'
-
-# Set up default roles for permissions
-setDefaultRoles(AddTopics, ('Manager',))
-setDefaultRoles(ChangeTopics, ('Manager', 'Owner',))
+from warnings import warn
+warn( "The module, 'Products.CMFTopic.TopicPermissions' is a deprecated "
+ "compatiblity alias for 'Products.CMFTopic.permissions'; please use "
+ "the new module instead.", DeprecationWarning)
=== CMF/CMFTopic/__init__.py 1.13 => 1.14 ===
--- CMF/CMFTopic/__init__.py:1.13 Thu Aug 1 15:05:13 2002
+++ CMF/CMFTopic/__init__.py Thu Apr 29 12:13:22 2004
@@ -14,19 +14,19 @@
$Id$
"""
+
+from ZClasses import createZClassForBase
+
+from Products.CMFCore.utils import ContentInit
+from Products.CMFCore.DirectoryView import registerDirectory
-import TopicPermissions
import Topic
import SimpleStringCriterion
import SimpleIntCriterion
import ListCriterion
import DateCriteria
import SortCriterion
-
-from Products.CMFCore.utils import ContentInit
-from Products.CMFCore.DirectoryView import registerDirectory
-
-from ZClasses import createZClassForBase
+from permissions import AddTopics
bases = ( Topic.Topic, )
@@ -52,7 +52,7 @@
# CMF Initializers
ContentInit( 'CMF Topic Objects'
, content_types = (Topic.Topic,)
- , permission = TopicPermissions.AddTopics
+ , permission = AddTopics
, extra_constructors = (Topic.addTopic,)
, fti = Topic.factory_type_information
).initialize( context )
More information about the CMF-checkins
mailing list