本文整理汇总了Python中AccessControl.SecurityInfo.ModuleSecurityInfo类的典型用法代码示例。如果您正苦于以下问题:Python ModuleSecurityInfo类的具体用法?Python ModuleSecurityInfo怎么用?Python ModuleSecurityInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModuleSecurityInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ModuleSecurityInfo
# 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.
#
##############################################################################
""" CMFCore product permissions. """
from AccessControl import Permissions
from AccessControl.Permission import _registeredPermissions
from AccessControl.Permission import ApplicationDefaultPermissions
from AccessControl.Permission import pname
from AccessControl.SecurityInfo import ModuleSecurityInfo
security = ModuleSecurityInfo("Products.CMFCore.permissions")
#
# General Zope permissions
#
security.declarePublic("AccessContentsInformation")
AccessContentsInformation = Permissions.access_contents_information
security.declarePublic("ChangePermissions")
ChangePermissions = Permissions.change_permissions
security.declarePublic("DeleteObjects")
DeleteObjects = Permissions.delete_objects
security.declarePublic("FTPAccess")
示例2: ModuleSecurityInfo
# -*- 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"
示例3: ModuleSecurityInfo
from DocumentTemplate.DT_Var import whole_dollars
from DocumentTemplate.DT_Var import dollars_and_cents
from DocumentTemplate.DT_Var import structured_text
from DocumentTemplate.DT_Var import sql_quote
from DocumentTemplate.DT_Var import html_quote
from DocumentTemplate.DT_Var import url_quote
from DocumentTemplate.DT_Var import url_quote_plus
from DocumentTemplate.DT_Var import newline_to_br
from DocumentTemplate.DT_Var import thousands_commas
from DocumentTemplate.DT_Var import url_unquote
from DocumentTemplate.DT_Var import url_unquote_plus
from DocumentTemplate.DT_Var import restructured_text
from DocumentTemplate.security import RestrictedDTML
from ZPublisher.HTTPRequest import record
security = ModuleSecurityInfo()
security.declarePublic('special_formats',
'whole_dollars',
'dollars_and_cents',
'structured_text',
'restructured_text',
'sql_quote',
'html_quote',
'url_quote',
'url_quote_plus',
'newline_to_br',
'thousands_commas',
'url_unquote',
'url_unquote_plus',
'urlencode',
示例4: Copyright
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
""" GenericSetup product exceptions.
$Id: exceptions.py 110425 2010-04-01 17:19:14Z tseaver $
"""
from AccessControl.SecurityInfo import ModuleSecurityInfo
security = ModuleSecurityInfo('Products.GenericSetup.exceptions')
security.declarePublic('BadRequest')
from zExceptions import BadRequest
示例5: ModuleSecurityInfo
from OFS.PropertyManager import PropertyManager
from OFS.PropertySheets import PropertySheets
from OFS.SimpleItem import SimpleItem
from thread import allocate_lock
from webdav.common import rfc1123_date
from zope.component import getUtility
from zope.component.interfaces import ComponentLookupError
from zope.dottedname.resolve import resolve as resolve_dotted_name
from zope.i18nmessageid import MessageFactory
from Products.CMFCore.exceptions import AccessControl_Unauthorized
from Products.CMFCore.exceptions import NotFound
SUBTEMPLATE = '__SUBTEMPLATE__'
security = ModuleSecurityInfo( 'Products.CMFCore.utils' )
_globals = globals()
_dtmldir = os_path.join( package_home( globals() ), 'dtml' )
_wwwdir = os_path.join( package_home( globals() ), 'www' )
#
# Simple utility functions, callable from restricted code.
#
_marker = [] # Create a new marker object.
_tool_interface_registry = {}
security.declarePrivate('registerToolInterface')
def registerToolInterface(tool_id, tool_interface):
""" Register a tool ID for an interface
示例6: ModuleSecurityInfo
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
""" GenericSetup product initialization.
"""
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.GenericSetup.interfaces import BASE
from Products.GenericSetup.interfaces import EXTENSION
from Products.GenericSetup.permissions import ManagePortal
from Products.GenericSetup.registry import _profile_registry \
as profile_registry
security = ModuleSecurityInfo('Products.GenericSetup')
security.declareProtected(ManagePortal, 'profile_registry')
def initialize(context):
import tool
context.registerClass(tool.SetupTool,
constructors=(#tool.addSetupToolForm,
tool.addSetupTool,
),
permissions=(ManagePortal,),
interfaces=None,
icon='www/tool.png',
)
示例7: ModuleSecurityInfo
#
##############################################################################
""" Some common utilities.
$Id$
"""
import os
from AccessControl.Permission import Permission
from AccessControl.Role import gather_permissions
from AccessControl.SecurityInfo import ModuleSecurityInfo
from App.Common import package_home
from zope.i18nmessageid import MessageFactory
security = ModuleSecurityInfo('Products.DCWorkflow.utils')
_dtmldir = os.path.join( package_home( globals() ), 'dtml' )
_xmldir = os.path.join( package_home( globals() ), 'xml' )
def ac_inherited_permissions(ob, all=0):
# Get all permissions not defined in ourself that are inherited
# This will be a sequence of tuples with a name as the first item and
# an empty tuple as the second.
d = {}
perms = getattr(ob, '__ac_permissions__', ())
for p in perms: d[p[0]] = None
r = gather_permissions(ob.__class__, [], d)
if all:
if hasattr(ob, '_subobject_permissions'):
示例8: ModuleSecurityInfo
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles
security = ModuleSecurityInfo('Products.CMFCore.permissions')
security.declarePublic("DexterityImport")
DexterityImport = "collective.importexport: Import"
#TODO: should allow readers to seee this too since they can do an export?
setDefaultRoles(DexterityImport, ("Owner", "Contributor" "Site Administrator", "Manager"))
示例9: ModuleSecurityInfo
# 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.CMFEditions import Permissions
from Products.CMFCore.permissions import setDefaultRoles
from AccessControl.SecurityInfo import ModuleSecurityInfo
security = ModuleSecurityInfo('plone.app.iterate.permissions')
security.declarePublic('CheckinPermission')
CheckinPermission = "iterate : Check in content"
security.declarePublic('CheckoutPermission')
CheckoutPermission = "iterate : Check out content"
DEFAULT_ROLES = ('Manager', 'Owner', 'Site Administrator', 'Editor')
setDefaultRoles(CheckinPermission, DEFAULT_ROLES)
setDefaultRoles(CheckoutPermission, DEFAULT_ROLES)
示例10: ModuleSecurityInfo
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles
security = ModuleSecurityInfo('slc.docconv')
security.declarePublic('Convert')
Convert = 'slc.docconv: Convert'
setDefaultRoles(Convert, ('Manager'))
示例11: ModuleSecurityInfo
# -*- coding: utf-8 -*-
from Products.CMFCore.permissions import setDefaultRoles
from AccessControl.SecurityInfo import ModuleSecurityInfo
security = ModuleSecurityInfo('rt.lastmodifier.permissions')
security.declarePublic('DocumentByLineViewAuthor')
DocumentByLineViewAuthor = 'rt.lastmodifier: documentByLine view author'
setDefaultRoles(DocumentByLineViewAuthor, ())
security.declarePublic('DocumentByLineViewLastModifier')
DocumentByLineViewLastModifier = 'rt.lastmodifier: documentByLine view last modifier'
setDefaultRoles(DocumentByLineViewLastModifier, ())
security.declarePublic('DocumentByLineViewModifiedDate')
DocumentByLineViewModifiedDate = 'rt.lastmodifier: documentByLine view modification date'
setDefaultRoles(DocumentByLineViewModifiedDate, ())
security.declarePublic('DocumentByLineViewPublishedDate')
DocumentByLineViewPublishedDate = 'rt.lastmodifier: documentByLine view publication date'
setDefaultRoles(DocumentByLineViewPublishedDate, ())
security.declarePublic('DocumentByLineViewChangeNote')
DocumentByLineViewChangeNote = 'rt.lastmodifier: documentByLine view change note'
setDefaultRoles(DocumentByLineViewChangeNote, ())
security.declarePublic('EditChangeNoteShowState')
EditChangeNoteShowState = 'rt.lastmodifier: choose to show change note'
setDefaultRoles(EditChangeNoteShowState, ())
示例12: ModuleSecurityInfo
# -*- coding: utf-8 -*-
from AccessControl.SecurityInfo import ModuleSecurityInfo
PROJECTNAME = "domense.homeboxes"
security = ModuleSecurityInfo(PROJECTNAME)
security.declarePublic('ManageSettings')
ManageSettings = PROJECTNAME + ': Manage Homeboxes settings'
示例13: ModuleSecurityInfo
"""Define CMFNotification specific permissions.
$Id$
"""
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles
from config import PROJECT_NAME
security = ModuleSecurityInfo(PROJECT_NAME)
security.declarePublic('CMFNotification: Subscribe/unsubscribe')
## Warning: this value is also defined in ``profiles/default/rolemap.xml``
SUBSCRIBE_PERMISSION = 'CMFNotification: Subscribe/unsubscribe'
setDefaultRoles(SUBSCRIBE_PERMISSION, ())
示例14: ModuleSecurityInfo
from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
from zope.component import getUtility
from zope.component import queryUtility
from zope.dottedname.resolve import resolve as resolve_dotted_name
from zope.i18nmessageid import MessageFactory
from zope.interface.interfaces import ComponentLookupError
from .exceptions import AccessControl_Unauthorized
from .exceptions import NotFound
from .interfaces import ICachingPolicyManager
SUBTEMPLATE = '__SUBTEMPLATE__'
ProductsPath = [abspath(ppath) for ppath in Products.__path__]
security = ModuleSecurityInfo('Products.CMFCore.utils')
_globals = globals()
_dtmldir = os_path.join(package_home(globals()), 'dtml')
_wwwdir = os_path.join(package_home(globals()), 'www')
#
# Simple utility functions, callable from restricted code.
#
_marker = [] # Create a new marker object.
_tool_interface_registry = {}
@security.private
def registerToolInterface(tool_id, tool_interface):
示例15: ModuleSecurityInfo
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Products.CMFCore.permissions import setDefaultRoles
#http://developer.plone.org/security/custom_permissions.html
security = ModuleSecurityInfo('collective.rcse')
TYPE_ROLES = ('Manager', 'Site Administrator', 'Owner')
perms = []
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"