Пример #1
0
def initialize():

    # the permission dict for all content types in this project.
    # What we are trying to do here is adding a "Add" permission for
    # each content type, and assigning default roles for this
    # permission to 'Manager' and 'Owner'.
    # We do NOT have to do this.  We are free to add whatever
    # permission with whatever name (Of course, with some convention
    # on the name, it is much easier to management).
    permissions = {}

    # get all content types within this project.
    types = atapi.listTypes(config.PROJECTNAME)

    for aType in types:

        permission = '%s: Add %s' % (config.PROJECTNAME,
                                     aType['portal_type'])
        permissions[aType['portal_type']] = permission

        # the setDefaultRoles method will also add this new permission
        # to the Plone site.
        CMFCorePermissions.setDefaultRoles(permission,
                                           ('Manager', 'Owner'))

    return permissions
Пример #2
0
def initialize(context):
    """load up content types"""
    from Products.CMFCore import utils as cmf_utils
    #app = context._ProductContext__app
    #patch_listDefaultTypeInformation(app)

    from ironicwiki import IronicWiki
    try:
        from wickeddoc import WickedDoc
    except ImportError: # no ATCT
        pass

    types = atapi.listTypes(PROJECTNAME)
    content_types, constructors, ftis = atapi.process_types( types,
                                                             PROJECTNAME)
    permissions = {}
    types = atapi.listTypes(PROJECTNAME)

    for atype in  types:
        permission = "%s: Add %s" % (PROJECTNAME, atype['portal_type'])
        permissions[atype['portal_type']] = permission

        # Assign default roles
        setDefaultRoles(permission, ('Manager', 'Owner'))

    allTypes = zip(content_types, constructors)
    for atype, constructor in allTypes:
        kind = "%s: %s" % (PROJECTNAME, atype.archetype_name)
        cmf_utils.ContentInit(
            kind,
            content_types      = (atype,),
            permission         = permissions[atype.portal_type],
            extra_constructors = (constructor,),
            fti                = ftis,
            ).initialize(context)
Пример #3
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)
    for atype in  types:
        permission = "%s: Add %s" % (config.PROJECTNAME, atype['portal_type'])
        permissions[atype['portal_type']] = permission
        setDefaultRoles(permission, ('Manager','Owner'))

    return permissions
Пример #4
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)
    for atype in types:
        permission = "%s: Add %s" % (config.PROJECTNAME, atype['portal_type'])
        permissions[atype['portal_type']] = permission
        setDefaultRoles(permission, ('Manager', 'Owner'))

    return permissions
Пример #5
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)
    for atype in  types:
        permission = _formatPermissionForType(atype['portal_type'])
        permissions[atype['portal_type']] = permission
        cmfpermissions.setDefaultRoles(permission, ('Manager','Owner', 'Contributor'))
    ManageTeamMembership = 'Manage team memberships'
    cmfpermissions.setDefaultRoles(ManageTeamMembership, ('Manager',))
    return permissions
Пример #6
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)
    for atype in  types:
        permission = _formatPermissionForType(atype['portal_type'])
        permissions[atype['portal_type']] = permission
        cmfpermissions.setDefaultRoles(permission, ('Manager','Owner', 'Contributor'))
    ManageTeamMembership = 'Manage team memberships'
    cmfpermissions.setDefaultRoles(ManageTeamMembership, ('Manager',))
    return permissions
Пример #7
0
def initialize(context):
    """Initializer called when used as a Zope 2 product.

    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
    is necessary for GenericSetup profiles to work, for example.

    Here, we call the Archetypes machinery to register our content types
    with Zope and the CMF.
    """

    setDefaultRoles(BLOG_PERMISSION, ())
Пример #8
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)
    for atype in types:
        portal_type = atype['portal_type']
        permission = ADD_PERMISSIONS.get(portal_type, None)
        if permission is None:
            permission = "%s: Add %s" % (config.PROJECTNAME, portal_type)
            setDefaultRoles(permission, ('Manager',))
        permissions[portal_type] = permission

    return permissions
def wireAddPermissions():
    """Creates a list of add permissions for all types in this project
    
    Must be called **after** all types are registered!
    """
    
    global permissions
    all_types = listTypes(PROJECT_NAME)
    for atype in all_types:
        permission = "%s: Add %s" % (PROJECT_NAME, atype['portal_type'])
        setDefaultRoles(permission, TYPE_ROLES)
        permissions[atype['portal_type']] = permission
    return permissions
def wireAddPermissions():
    """Creates a list of add permissions for all types in this project
    
    Must be called **after** all types are registered!
    """
    global permissions
    issue_types = listTypes(PROJECTNAME)
    for itype in issue_types:
        permission = "%s: Add %s" % (PROJECTNAME, itype['portal_type'])
        setDefaultRoles(permission, TYPE_ROLES)
        
        permissions[itype['portal_type']] = permission
    return permissions
Пример #11
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECT_NAME)
    for atype in types:
        portal_type = atype['portal_type']
        permission = ADD_PERMISSIONS.get(portal_type, None)
        if permission is None:
            # construct a permission on the fly
            permission = "%s: Add %s" % (config.PROJECT_NAME,
                                         portal_type)
            cmfcore_permissions.setDefaultRoles(permission, ('Manager',))
        permissions[portal_type] = permission

    return permissions
Пример #12
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECT_NAME)
    for atype in types:
        portal_type = atype['portal_type']
        permission = ADD_PERMISSIONS.get(portal_type, None)
        if permission is None:
            # construct a permission on the fly
            permission = "%s: Add %s" % (config.PROJECT_NAME,
                                         portal_type)
            print '>>> remember permission: ', permission
            cmfcore_permissions.setDefaultRoles(permission, ('Manager',))
        permissions[portal_type] = permission

    return permissions
Пример #13
0
def install(portal):
    if localAdaptersAreSupported:
        installExtender(portal, PersonExtender, _adapterName)
    setDefaultRoles('IMSSS: view membership details', ())
    setDefaultRoles('IMSSS: modify membership details', ())
    setDefaultRoles('IMSSS: view secure membership details', ())
    setDefaultRoles('IMSSS: modify secure membership details', ())
    _runProfile('profile-Products.IMSSSMembers:default', portal)
Пример #14
0
def install(portal):
    if localAdaptersAreSupported:
        installExtender(portal, PersonExtender, _adapterName)
    setDefaultRoles('IMSSS: view membership details', ())
    setDefaultRoles('IMSSS: modify membership details', ())
    setDefaultRoles('IMSSS: view secure membership details', ())
    setDefaultRoles('IMSSS: modify secure membership details', ())
    _runProfile('profile-Products.IMSSSMembers:default', portal)
Пример #15
0
def initialize():
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)

    for atype in types:
        typename = atype['name']
        if typename in DEFAULT_ADD_PERMISSIONS:
            permissions[atype['portal_type']] = DEFAULT_ADD_PERMISSIONS[typename]
        else:
            permission = "%s: Add %s" % (config.PROJECTNAME, atype['portal_type'])
            setDefaultRoles(permission, ('Manager',))
            permissions[atype['portal_type']] = permission

    perms_to_set = [MakeContentVisible, ViewEmails]
    for permission in perms_to_set:
        setDefaultRoles(permission, ('Manager',))

    return permissions
def wireAddPermissions():
    """Creates a list of add permissions for all types in this project

    Must be called **after** all types are registered!
    """
    global permissions
    atct_types = listTypes(PROJECTNAME)
    for atct in atct_types:
        if IATTopic.implementedBy(atct['klass']):
            permission = AddTopics
        elif IATTopicCriterion.implementedBy(atct['klass']):
            permission = "%s Topic: Add %s" % (PROJECTNAME, atct['portal_type'])
            setDefaultRoles(permission, CRITERION_ROLES)
        else:
            permission = "%s: Add %s" % (PROJECTNAME, atct['portal_type'])
            setDefaultRoles(permission, TYPE_ROLES)

        permissions[atct['portal_type']] = permission
    return permissions
Пример #17
0
def initialize():
    # Container that stores permission according to contents type finally 
    # output.
    permissions = {}

    # The list of the contents type registered to Archetype is acquired.
    types = atapi.listTypes(config.PROJECTNAME)

    # The permission setting of each contents type is added.
    for atype in  types:
        # The permission name displayed in the permission tab of ZMI is 
        # made.
        permission = "%s: Add %s" % (config.PROJECTNAME, atype['portal_type'])

        # The permission made for the dictionary of the contents type is 
        # preserved.
        permissions[atype['portal_type']] = permission

        # The permission name and the access permit at each roll 
        # corresponding to the permission name is set to CMFCore.
        CMFCorePermissions.setDefaultRoles(permission, ('Manager','Owner'))

    return permissions
Пример #18
0
def initialize(context):
    """Initializer called when used as a Zope 2 product.

    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
    is necessary for GenericSetup profiles to work, for example.

    Here, we call the Archetypes machinery to register our content types
    with Zope and the CMF.
    """

    setDefaultRoles('uwosh.timeslot: Manage Schedule', ())
    setDefaultRoles('uwosh.timeslot: View Schedule', ())

    # Retrieve the content types that have been registered with Archetypes
    # This happens when the content type is imported and the registerType()
    # call in the content type's module is invoked. Actually, this happens
    # during ZCML processing, but we do it here again to be explicit. Of
    # course, even if we import the module several times, it is only run
    # once.

    content_types, constructors, ftis = atapi.process_types(
        atapi.listTypes(config.PROJECTNAME), config.PROJECTNAME)

    # Now initialize all these content types. The initialization process takes
    # care of registering low-level Zope 2 factories, including the relevant
    # add-permission. These are listed in config.py. We use different
    # permissions for each content type to allow maximum flexibility of who
    # can add which content types, where. The roles are set up in rolemap.xml
    # in the GenericSetup profile.

    for atype, constructor in zip(content_types, constructors):
        utils.ContentInit(
            '%s: %s' % (config.PROJECTNAME, atype.portal_type),
            content_types=(atype, ),
            permission=config.ADD_PERMISSIONS[atype.portal_type],
            extra_constructors=(constructor, ),
        ).initialize(context)
Пример #19
0
def initialize(context):
    """Initializer called when used as a Zope 2 product.

    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
    is necessary for GenericSetup profiles to work, for example.

    Here, we call the Archetypes machinery to register our content types
    with Zope and the CMF.
    """

    setDefaultRoles('uwosh.timeslot: Manage Schedule', ())
    setDefaultRoles('uwosh.timeslot: View Schedule', ())

    # Retrieve the content types that have been registered with Archetypes
    # This happens when the content type is imported and the registerType()
    # call in the content type's module is invoked. Actually, this happens
    # during ZCML processing, but we do it here again to be explicit. Of
    # course, even if we import the module several times, it is only run
    # once.

    content_types, constructors, ftis = atapi.process_types(
        atapi.listTypes(config.PROJECTNAME),
        config.PROJECTNAME)

    # Now initialize all these content types. The initialization process takes
    # care of registering low-level Zope 2 factories, including the relevant
    # add-permission. These are listed in config.py. We use different
    # permissions for each content type to allow maximum flexibility of who
    # can add which content types, where. The roles are set up in rolemap.xml
    # in the GenericSetup profile.

    for atype, constructor in zip(content_types, constructors):
        utils.ContentInit('%s: %s' % (config.PROJECTNAME, atype.portal_type),
            content_types      = (atype,),
            permission         = config.ADD_PERMISSIONS[atype.portal_type],
            extra_constructors = (constructor,),
            ).initialize(context)
Пример #20
0
def initialize():
    # Container that stores permission according to contents type finally 
    # output.
    permissions = {}

    # The list of the contents type registered to Archetype is acquired.
    types = listTypes(PROJECTNAME)

    # The permission setting of each contents type is added.
    for atype in  types:
        # The permission name displayed in the permission tab of ZMI is 
        # made.
        permission = "%s: Add %s" % (PROJECTNAME, atype['portal_type'])
        log.debug("Adding permission - > " + permission)

        # The permission made for the dictionary of the contents type is 
        # preserved.
        permissions[atype['portal_type']] = permission

        # The permission name and the access permit at each roll 
        # corresponding to the permission name is set to CMFCore.
        CMFCorePermissions.setDefaultRoles(permission, ('Manager','Owner'))

    return permissions
Пример #21
0
from Products.CMFCore.permissions import setDefaultRoles
from zope.i18nmessageid import MessageFactory

MailmanMessageFactory = MessageFactory('collective.portlet.mailman')

setDefaultRoles('collective.portlet.mailman: Add Mailman portlet',
                ('Manager', 'Site Administrator', 'Owner', ))
#EOF
Пример #22
0
try:
    from Products.CMFCore.permissions import AddPortalContent
    from Products.CMFCore.permissions import setDefaultRoles
    AddPortalContent, setDefaultRoles  # pyflakes
except ImportError:
    from Products.CMFCore.CMFCorePermissions import AddPortalContent
    from Products.CMFCore.CMFCorePermissions import setDefaultRoles

ADD_CENTER_PERMISSION = 'PloneHelpCenter: Add Plone Help Center'
ADD_CONTENT_PERMISSION = AddPortalContent
ADD_HELP_AREA_PERMISSION = 'PloneHelpCenter: Add Help Center Area'
ADD_DOCUMENTATION_PERMISSION = 'PloneHelpCenter: Add Documentation'

# Let members by default be allowed to add documentation, and managers only
# be able to add new documentation areas
setDefaultRoles(ADD_CENTER_PERMISSION, ('Manager', ))
setDefaultRoles(ADD_HELP_AREA_PERMISSION, (
    'Manager',
    'Owner',
))
setDefaultRoles(ADD_DOCUMENTATION_PERMISSION, (
    'Manager',
    'Member',
))

PROJECTNAME = "PloneHelpCenter"
SKINS_DIR = 'skins'

GLOBALS = globals()

# If plone.memoize is available, the minutes to cache
from zope.i18nmessageid import MessageFactory
PloneMessageFactory = MessageFactory('plone')

from Products.CMFCore.permissions import setDefaultRoles
setDefaultRoles('signature.portlets.gdsignature: Add GroupDocs Signature portlet',
                ('Manager', 'Site Administrator', 'Owner',))
Пример #24
0
#
# If you wish to perform custom configuration, you may put a file
# AppConfig.py in your product's root directory. The items in there
# will be included (by importing) in this file if found.

from Products.CMFCore.permissions import setDefaultRoles
##code-section config-head #fill in your manual code here
##/code-section config-head


PROJECTNAME = "TextAndFonts"

# Permissions
VIEW_PERMISSION = "View"
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner', 'Contributor'))
setDefaultRoles(VIEW_PERMISSION,('Anonymous','Authenticated'))
ADD_CONTENT_PERMISSIONS = {
    'Font': 'Newspaper: Add Font',
}

setDefaultRoles('Newspaper: Add Font', ('Manager','Owner'))

product_globals = globals()

# Dependencies of Products to be installed by quick-installer
# override in custom configuration
DEPENDENCIES = []

# Dependend products - not quick-installed - used in testcase
# override in custom configuration
#
# $Id: PNLPermissions.py 50069 2007-09-24 15:47:16Z naro $
#
__doc__ = """Define new permissions for newsletter handling
$Id: PNLPermissions.py 50069 2007-09-24 15:47:16Z naro $
"""
__version__ = "$Revision: 50069 $" [11:-2]

from Products.CMFCore.permissions import setDefaultRoles

# New specific permissions

AddNewsletterTheme = 'PNL Add Newsletter Theme'
ChangeNewsletterTheme = 'PNL Change Newsletter Theme'
AddNewsletter = 'PNL Add Newsletter'
ChangeNewsletter = 'PNL Change Newsletter'
AddSubscriber = 'PNL Add Subscriber'
ChangeSubscriber = 'PNL Change Subscriber'

# Default roles for those permissions
setDefaultRoles(AddNewsletterTheme, ('Manager',))
setDefaultRoles(ChangeNewsletterTheme, ('Manager', 'Owner'))
setDefaultRoles(AddNewsletter, ('Manager',))
setDefaultRoles(ChangeNewsletter, ('Manager', 'Owner'))
setDefaultRoles(AddSubscriber, ('Anonymous', 'Manager', 'Owner', 'Member'))
setDefaultRoles(ChangeSubscriber, ('Anonymous', 'Manager', 'Owner'))
Пример #26
0
#
# (C) Copyright 2006 ObjectRealms, LLC
# All Rights Reserved
#
# This file is part of iterate.
#
# iterate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# iterate is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with CMFDeployment; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
##################################################################

from Products.CMFCore.permissions import setDefaultRoles


CheckinPermission = 'iterate : Check in content'
CheckoutPermission = 'iterate : Check out content'

DEFAULT_ROLES = ('Manager', 'Owner', 'Site Administrator', 'Editor')
setDefaultRoles(CheckinPermission, DEFAULT_ROLES)
setDefaultRoles(CheckoutPermission, DEFAULT_ROLES)
Пример #27
0
from Products.CMFCore.permissions import setDefaultRoles
from zope.i18nmessageid import MessageFactory

_ = MessageFactory("ftw.usermigration")

setDefaultRoles("ftw.usermigration: Migrate users", ("Manager", "Site Administrator"))
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

security = ModuleSecurityInfo('plumi.content')

security.declarePublic('ReTranscodePermission')
ReTranscodePermission = 'plumi.content: ReTranscode Video'
setDefaultRoles(ReTranscodePermission, ())
Пример #29
0
##############################################################################
#
# Copyright (c) 2003-2005 Kupu Contributors. All rights reserved.
#
# This software is distributed under the terms of the Kupu
# License. See LICENSE.txt for license text. For a list of Kupu
# Contributors see CREDITS.txt.
#
##############################################################################
"""Zope2 permissions for server-side Kupu interaction

$Id: permissions.py 9879 2005-03-18 12:04:00Z yuppie $
"""
try:
    from Products.CMFCore.permissions import setDefaultRoles
except ImportError:
    # for CMF 1.4
    from Products.CMFCore.CMFCorePermissions import setDefaultRoles

QueryLibraries = "Kupu: Query libraries"
ManageLibraries = "Kupu: Manage libraries"

# Set up default roles for permissions
setDefaultRoles(QueryLibraries, ('Manager', 'Member'))
setDefaultRoles(ManageLibraries, ('Manager', ))
from Products.CMFCore.permissions import setDefaultRoles

PROJECTNAME = "collective.portlet.mybookmarks"

addUserBookmark = PROJECTNAME + ": Add User Bookmark"
delUserBookmark = PROJECTNAME + ": Remove User Bookmark"

setDefaultRoles(addUserBookmark, ('Manager', ))
setDefaultRoles(delUserBookmark, ('Manager', ))
Пример #31
0
from Products.CMFCore.permissions import setDefaultRoles


# manage discount
ManageDiscount = 'bda.plone.discount: Manage Discount'
setDefaultRoles(ManageDiscount,
                ('Manager', 'Site Administrator'))
Пример #32
0
"""Common configuration constants
"""
from AccessControl import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

PROJECTNAME = 'raptus.article.maps'

security = ModuleSecurityInfo('raptus.article.maps.config')

security.declarePublic('ADD_PERMISSION')
ADD_PERMISSION = {}

ADD_PERMISSION['Map'] = 'raptus.article: Add Map'
setDefaultRoles(ADD_PERMISSION['Map'], ('Manager','Contributor',))

ADD_PERMISSION['Marker'] = 'raptus.article: Add Marker'
setDefaultRoles(ADD_PERMISSION['Marker'], ('Manager','Contributor',))
Пример #33
0
#
# The contents of this module will be imported into __init__.py, the
# workflow configuration and every content type module.
#
# If you wish to perform custom configuration, you may put a file
# AppConfig.py in your product's root directory. This will be included
# in this file if found.

from Products.CMFCore.permissions import setDefaultRoles


PROJECTNAME = "Poi"

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ("Manager", "Owner"))
ADD_CONTENT_PERMISSIONS = {
    "PoiTracker": "Poi: Add Tracker",
    "PoiIssue": "Poi: Add Issue",
    "PoiResponse": "Poi: Add Response",
}

setDefaultRoles("Poi: Add Tracker", ("Manager",))
setDefaultRoles("Poi: Add Issue", ("Anonymous", "Manager", "Member", "Owner"))
setDefaultRoles("Poi: Add Response", ("Anonymous", "Manager", "Member", "Owner"))

product_globals = globals()

# Dependend products - not quick-installed - used in testcase
# override in custom configuration
PRODUCT_DEPENDENCIES = []
Пример #34
0
    permissions = {}
    types = atapi.listTypes(config.PROJECTNAME)
    for atype in  types:
        permission = _formatPermissionForType(atype['portal_type'])
        permissions[atype['portal_type']] = permission
        cmfpermissions.setDefaultRoles(permission, ('Manager','Owner', 'Contributor'))
    ManageTeamMembership = 'Manage team memberships'
    cmfpermissions.setDefaultRoles(ManageTeamMembership, ('Manager',))
    return permissions

View = cmfpermissions.View
AddContent = cmfpermissions.AddPortalContent
EditContent = cmfpermissions.ModifyPortalContent
DeleteContent = cmfpermissions.DeleteObjects
ViewDrafts = 'Quills: View Drafts'
cmfpermissions.setDefaultRoles(ViewDrafts, ('Manager','Owner'))


def getQuillsAddPermissions():
    """Return a sequence of all the 'add' permissions for Quills types.
    """
    qtypes = atapi.listTypes(config.PROJECTNAME)
    perms = []
    for atype in  qtypes:
        permission = _formatPermissionForType(atype['portal_type'])
        perms.append(permission)
    return perms

def unsetupPortalSecurity(portal, out=None):
    pass
Пример #35
0
"""Main product initializer
"""

from zope.i18nmessageid import MessageFactory

from Products.CMFCore.permissions import setDefaultRoles
scoMessageFactory = MessageFactory('eduintelligent.sco')

setDefaultRoles("ediIntelligent: Add SCO", ('Manager',))

def initialize(context):
    """Intializer called when used as a Zope 2 product."""    
    pass
    
Пример #36
0
##/code-section config-head


PROJECTNAME = "BungeniSkin"

# Check for Plone 2.1
try:
    from Products.CMFPlone.migrations import v2_1
except ImportError:
    HAS_PLONE21 = False
else:
    HAS_PLONE21 = True

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner'))

product_globals = globals()

# Dependencies of Products to be installed by quick-installer
# override in custom configuration
DEPENDENCIES = []

# Dependend products - not quick-installed - used in testcase
# override in custom configuration
PRODUCT_DEPENDENCIES = []

# You can overwrite these two in an AppConfig.py:
# STYLESHEETS = [{'id': 'my_global_stylesheet.css'},
#                {'id': 'my_contenttype.css',
#                 'expression': 'python:object.getTypeInfo().getId() == "MyType"'}]
Пример #37
0
# -*- coding: utf-8 -*-
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

security = ModuleSecurityInfo('cpskin.core.permissions')

security.declarePublic('CPSkinSiteAdministrator')
CPSkinSiteAdministrator = 'CPSkin: Site administrator'
setDefaultRoles(CPSkinSiteAdministrator, ('Site Administrator', 'Manager'))

security.declarePublic('CPSkinEditKeywords')
CPSkinEditKeywords = 'CPSkin: Edit keywords'
setDefaultRoles(CPSkinEditKeywords,
                ('Site Administrator', 'Manager', 'Portlets Manager'))
Пример #38
0
# -*- coding: utf-8 -*-

from Products.CMFCore.permissions import setDefaultRoles
from AccessControl import ModuleSecurityInfo

security = ModuleSecurityInfo("collective.dancefloor")

PROJECTNAME = 'collective.dancefloor'

#permission to manage local newsletters
security.declarePublic("DelegateLocalNewsletterManager")
DelegateLocalNewsletterManager = "Sharing page: delegate Local Newsletter Manager role"
setDefaultRoles(DelegateLocalNewsletterManager, ())

#permission to manage local newsletters
security.declarePublic("ManageLocalNewsletter")
ManageLocalNewsletter = "collective.dancefloor: Manage Local Newsletters"
setDefaultRoles(ManageLocalNewsletter, ('Manager', ))
Пример #39
0
for typename in (
        "article",
        "audio",
        "discussion",
        "etherpad",
        "event",
        "file",
        "group",
        "image",
        "video",
):
    ctype = "collective.rcse." + typename
    permid = 'Add' + typename.capitalize()
    permname = 'collective.rcse: Add ' + typename
    security.declarePublic(permid)
    setDefaultRoles(permname, TYPE_ROLES)

AddArticle = "collective.rcse: Add article"
AddAudio = "collective.rcse: Add audio"
AddDiscussion = "collective.rcse: Add discussion"
AddEtherpad = "collective.rcse: Add etherpad"
AddEvent = "collective.rcse: Add event"
AddFile = "collective.rcse: Add file"
AddGroup = "collective.rcse: Add group"
AddImage = "collective.rcse: Add image"
AddVideo = "collective.rcse: Add video"

security.declarePublic('AddCompany')
setDefaultRoles('collective.rcse: Add company', (
    'Manager',
    'Authenticated',
Пример #40
0
# -*- coding: utf-8 -*-
from Products.CMFCore.permissions import setDefaultRoles

packageName = __name__

AddFolder = 'ATContentTypes: Add Folder'
setDefaultRoles(AddFolder, ('Manager', 'Owner'))


def initialize(context):
    """ initializer called when used as a zope2 product """

    try:
        from Products.Archetypes import atapi
        from plone.app.folder import folder
    except ImportError:
        pass
    else:
        from Products.CMFCore import utils

        folder.__name__  # make pyflakes happy...

        content_types, constructors, ftis = atapi.process_types(
            atapi.listTypes(packageName), packageName)

        assert len(content_types) == 1, 'only one new folder, please!'

        for atype, constructor, fti in zip(content_types, constructors, ftis):
            utils.ContentInit(
                '%s: %s' % (packageName, atype.portal_type),
                content_types=(atype, ),
Пример #41
0
# The contents of this module will be imported into __init__.py, the
# workflow configuration and every content type module.
#
# If you wish to perform custom configuration, you may put a file
# AppConfig.py in your product's root directory. The items in there
# will be included (by importing) in this file if found.

from Products.CMFCore.permissions import setDefaultRoles
##code-section config-head #fill in your manual code here
##/code-section config-head

PROJECTNAME = "CompoundField"

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION,
                ('Manager', 'Owner', 'Contributor'))
ADD_CONTENT_PERMISSIONS = {
    'CompoundFieldTest': 'CompoundField: Add CompoundFieldTest',
    'ArrayFieldTest': 'CompoundField: Add ArrayFieldTest',
    'NestedArrayFieldTest': 'CompoundField: Add NestedArrayFieldTest',
}

setDefaultRoles('CompoundField: Add CompoundFieldTest', ('Manager', 'Owner'))
setDefaultRoles('CompoundField: Add ArrayFieldTest', ('Manager', 'Owner'))
setDefaultRoles('CompoundField: Add NestedArrayFieldTest',
                ('Manager', 'Owner'))

product_globals = globals()

# Dependencies of Products to be installed by quick-installer
# override in custom configuration
Пример #42
0
from AccessControl import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

security = ModuleSecurityInfo('pcommerce.core.config')

security.declarePublic('AddProduct')
AddProduct = 'PCommerce: Add Product'
setDefaultRoles(AddProduct, ('Manager','Contributer','Owner',))

security.declarePublic('AddVariation')
AddVariation = 'PCommerce: Add Variation'
setDefaultRoles(AddVariation, ('Manager','Contributer','Owner',))

security.declarePublic('AddImage')
AddVariation = 'PCommerce: Add Image'
setDefaultRoles(AddVariation, ('Manager','Contributer','Owner',))

security.declarePublic('AddPrice')
AddPrice = 'PCommerce: Add Price'
setDefaultRoles(AddPrice, ('Manager','Contributer','Owner',))

security.declarePublic('AddToCart')
AddToCart = 'PCommerce: Add to Cart'
setDefaultRoles(AddToCart, ('Anonymous', 'Authenticated',))

security.declarePublic('CheckOut')
CheckOut = 'PCommerce: Check out'
setDefaultRoles(CheckOut, ('Authenticated',))

security.declarePublic('ManageOrders')
ManageOrders = 'PCommerce: Manage Orders'
Пример #43
0
# -*- coding: utf-8 -*-
"""Init and utils."""
from zope.i18nmessageid import MessageFactory
from Products.CMFCore.permissions import setDefaultRoles
_ = MessageFactory('imio.media')


def initialize(context):
    """Initializer called when used as a Zope 2 product."""


PROJECTNAME = "imio.media"
DEFAULT_ADD_CONTENT_PERMISSION = "%s: Add media portlet" % PROJECTNAME
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, (
    'Manager',
    'Site Administrator',
    'Owner',
))
Пример #44
0
# 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')
Пример #45
0
#You can contact Cynapse at [email protected] with any problems with cyn.in.
#For any queries regarding the licensing, please send your mails to
# [email protected]
#
#You can also contact Cynapse at:
#802, Building No. 1,
#Dheeraj Sagar, Malad(W)
#Mumbai-400064, India
###############################################################################
from zope.i18nmessageid import MessageFactory
from Products.CMFCore.permissions import setDefaultRoles
from AccessControl import allow_module
from AccessControl import ModuleSecurityInfo
from Products.AdvancedQuery import Eq, Between, Le

setDefaultRoles("SmartView Add Smart view", ('Manager'))


def initialize(context):
    """Initializer called when used as a Zope 2 product."""
    ModuleSecurityInfo("ubify.smartview").declarePublic("getResults")
    ModuleSecurityInfo("ubify.smartview").declarePublic("getQValue")
    ModuleSecurityInfo("ubify.smartview").declarePublic(
        "getProcessResultForTimeLineView")

    pass


def getResults(context):
    results = []
    try:
Пример #46
0
# coding=utf-8
import os
from Globals import package_home
from Products.CMFCore.permissions import setDefaultRoles

# MessageFactory
from zope.i18nmessageid import MessageFactory
_ = MessageFactory("EasyShop")

PROJECTNAME = "easyshop.shop"

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner'))
ADD_CONTENT_PERMISSIONS = {
    "Customer": "EasyShop: Add Customer",
    "Address": "EasyShop: Add Address",
    "EasyShop": "EasyShop: Add EasyShop",
}

setDefaultRoles('EasyShop: Add Customer', ('Manager', ))

# Create path to default shop form
product_globals = globals()
home = package_home(product_globals)
DEFAULT_SHOP_FORM = os.path.sep.join([home, "browser", "default_shop_form.pt"])

# NOTE: All message have to be in the plone domain.
MESSAGES = {
    "CART_ADDED_PRODUCT": "The product has been added to the cart.",
    "CART_INCREASED_AMOUNT": "The amount of the product has been increased.",
Пример #47
0
# The contents of this module will be imported into __init__.py, the
# workflow configuration and every content type module.
#
# If you wish to perform custom configuration, you may put a file
# AppConfig.py in your product's root directory. The items in there
# will be included (by importing) in this file if found.

from Products.CMFCore.permissions import setDefaultRoles
##code-section config-head #fill in your manual code here
##/code-section config-head

PROJECTNAME = "PloneShows"

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION,
                ('Manager', 'Owner', 'Contributor'))
ADD_CONTENT_PERMISSIONS = {
    'Season': 'PloneShows: Add Season',
    'Show': 'PloneShows: Add Show',
    'Performance': 'PloneShows: Add Performance',
    'Now_Playing_Page': 'PloneShows: Add Now_Playing_Page',
}

setDefaultRoles('PloneShows: Add Season', ('Manager', 'Owner'))
setDefaultRoles('PloneShows: Add Show', ('Manager', 'Owner'))
setDefaultRoles('PloneShows: Add Performance', ('Manager', 'Owner'))
setDefaultRoles('PloneShows: Add Now_Playing_Page', ('Manager', 'Owner'))

product_globals = globals()

# Dependencies of Products to be installed by quick-installer
Пример #48
0
# workflow configuration and every content type module.
#
# If you wish to perform custom configuration, you may put a file
# AppConfig.py in your product's root directory. The items in there
# will be included (by importing) in this file if found.

from Products.CMFCore.permissions import setDefaultRoles
##code-section config-head #fill in your manual code here
##/code-section config-head


PROJECTNAME = "PloneShows"

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner', 'Contributor'))
ADD_CONTENT_PERMISSIONS = {
    'Season': 'PloneShows: Add Season',
    'Show': 'PloneShows: Add Show',
    'Performance': 'PloneShows: Add Performance',
    'Now_Playing_Page': 'PloneShows: Add Now_Playing_Page',
}

setDefaultRoles('PloneShows: Add Season', ('Manager','Owner'))
setDefaultRoles('PloneShows: Add Show', ('Manager','Owner'))
setDefaultRoles('PloneShows: Add Performance', ('Manager','Owner'))
setDefaultRoles('PloneShows: Add Now_Playing_Page', ('Manager','Owner'))

product_globals = globals()

# Dependencies of Products to be installed by quick-installer
Пример #49
0
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

security = ModuleSecurityInfo('collective.favoriting')

security.declarePublic('AddToFavorites')
AddToFavorites = 'collective.favoriting: Add'
setDefaultRoles(AddToFavorites, ('Member', 'Manager'))
Пример #50
0
# workflow configuration and every content type module.
#
# If you wish to perform custom configuration, you may put a file
# AppConfig.py in your product's root directory. The items in there
# will be included (by importing) in this file if found.

from Products.CMFCore.permissions import setDefaultRoles

##code-section config-head #fill in your manual code here
##/code-section config-head

PROJECTNAME = "CalendarX"

# Permissions
DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content"
setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner'))

product_globals = globals()

# Dependencies of Products to be installed by quick-installer
# override in custom configuration
DEPENDENCIES = []

# Dependend products - not quick-installed - used in testcase
# override in custom configuration
PRODUCT_DEPENDENCIES = []

# You can overwrite these two in an AppConfig.py:
# STYLESHEETS = [
#     {'id': 'my_global_stylesheet.css'},
#     {'id': 'my_contenttype.css',
Пример #51
0
from zope.i18nmessageid.message import MessageFactory

TMCEMessageFactory = MessageFactory('plone.tinymce')

from Products.CMFCore.DirectoryView import registerDirectory
from Products.CMFCore.permissions import setDefaultRoles
from Products.TinyMCE.utility import TinyMCE

global tinymce_globals

tinymce_globals = globals()
PROJECTNAME = "TinyMCE"

tools = (TinyMCE, )

setDefaultRoles('Plone Site Setup: TinyMCE', ('Manager', 'Site Administrator'))


def initialize(context):
    registerDirectory('skins', tinymce_globals)

    from Products.CMFCore import utils
    utils.ToolInit(
        "%s Tool" % PROJECTNAME,
        tools=tools,
        icon="browser/images/tinymce_icon.gif",
    ).initialize(context)
Пример #52
0
"""Common configuration constants
"""
from AccessControl import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

PROJECTNAME = 'raptus.filesystemindex'

security = ModuleSecurityInfo('raptus.filesystemindex.config')

security.declarePublic('ADD_PERMISSION')
ADD_PERMISSION = 'raptus.filesystemindex: Add FileSystemIndex'
setDefaultRoles(ADD_PERMISSION, ('Manager','Contributor',))
Пример #53
0
from Products.CMFCore.permissions import setDefaultRoles
from AccessControl import ModuleSecurityInfo

security = ModuleSecurityInfo("plone.app.workflow.permissions")

# Controls access to the "sharing" page
security.declarePublic("DelegateRoles")
DelegateRoles = "Sharing page: Delegate roles"
setDefaultRoles(DelegateRoles, (
    'Manager',
    'Site Administrator',
    'Owner',
    'Editor',
    'Reviewer',
))

# Control the individual roles
security.declarePublic("DelegateReaderRole")
DelegateReaderRole = "Sharing page: Delegate Reader role"
setDefaultRoles(
    DelegateReaderRole,
    ('Manager', 'Site Administrator', 'Owner', 'Editor', 'Reviewer'))

security.declarePublic("DelegateEditorRole")
DelegateEditorRole = "Sharing page: Delegate Editor role"
setDefaultRoles(DelegateEditorRole,
                ('Manager', 'Site Administrator', 'Owner', 'Editor'))

security.declarePublic("DelegateContributorRole")
DelegateContributorRole = "Sharing page: Delegate Contributor role"
setDefaultRoles(DelegateContributorRole, (
Пример #54
0
"""Common configuration constants
"""
from AccessControl import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles

PROJECTNAME = "raptus.article.media"

security = ModuleSecurityInfo("raptus.article.media.config")

security.declarePublic("ADD_PERMISSION")
ADD_PERMISSION = {}
ADD_PERMISSION["Video"] = "raptus.article: Add Video"
setDefaultRoles(ADD_PERMISSION["Video"], ("Manager", "Contributor"))

ADD_PERMISSION["VideoEmbed"] = "raptus.article: Add Embeded Video"
setDefaultRoles(ADD_PERMISSION["VideoEmbed"], ("Manager", "Contributor"))

ADD_PERMISSION["Audio"] = "raptus.article: Add Audio"
setDefaultRoles(ADD_PERMISSION["Audio"], ("Manager", "Contributor"))
Пример #55
0
##############################################################################
#
# Copyright (c) 2004-2006 CompositePack Contributors. All rights reserved.
#
# This software is distributed under the terms of the Zope Public
# License (ZPL) v2.1. See COPYING.txt for more information.
#
##############################################################################
"""
$Id$
"""
from Products.CMFCore.permissions import ManagePortal
from Products.CMFCore.permissions import setDefaultRoles
from Products.CMFCore.permissions import View
from Products.CMFCore.permissions import AddPortalContent

DesignCompo = 'Design Composite Page'
setDefaultRoles(DesignCompo, ('Manager', ))

ManageCompositePack = 'Manage Composite Pack'
setDefaultRoles(ManageCompositePack, ('Manager', ))
Пример #56
0
from Products.CMFCore.permissions import setDefaultRoles
try:
    from Products.LinguaPlone import public as atapi
except ImportError:
    from Products.Archetypes import atapi

packageName = __name__

ADD_PERMISSION = 'ATContentTypes: Add Event'  # ATContentTypes permissions
PORTAL_ADD_PERMISSION = 'Add portal events'  # CMFCalendar permissions
PORTAL_CHANGE_PERMISSION = 'Change portal events'

setDefaultRoles(
    ADD_PERMISSION,
    ('Manager', 'Site Administrator', 'Owner',)
)
setDefaultRoles(
    PORTAL_ADD_PERMISSION,
    ('Manager', 'Site Administrator', 'Owner',)
)
setDefaultRoles(
    PORTAL_CHANGE_PERMISSION,
    ('Manager', 'Site Administrator', 'Owner',)
)


def initialize(context):
    """Register content types through Archetypes with Zope and the CMF.
    """
    from Products.CMFCore.utils import ContentInit
    from plone.app.event.at import content  # nopep8
Пример #57
0
# -*- coding: utf-8 -*-
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles
from plone.app.contenttypes.utils import DEFAULT_TYPES

security = ModuleSecurityInfo('plone.app.contenttypes')

TYPE_ROLES = ('Manager', 'Site Administrator', 'Owner', 'Contributor')

perms = []

for typename in DEFAULT_TYPES:
    permid = 'Add' + typename
    permname = 'plone.app.contenttypes: Add ' + typename
    security.declarePublic(permid)
    setDefaultRoles(permname, TYPE_ROLES)

AddCollection = "plone.app.contenttypes: Add Collection"
AddDocument = "plone.app.contenttypes: Add Document"
AddEvent = "plone.app.contenttypes: Add Event"
AddFile = "plone.app.contenttypes: Add File"
AddFolder = "plone.app.contenttypes: Add Folder"
AddImage = "plone.app.contenttypes: Add Image"
AddLink = "plone.app.contenttypes: Add Link"
AddNewsItem = "plone.app.contenttypes: Add News Item"