当前位置: 首页>>代码示例>>Python>>正文


Python ModuleSecurityInfo.declareProtected方法代码示例

本文整理汇总了Python中AccessControl.SecurityInfo.ModuleSecurityInfo.declareProtected方法的典型用法代码示例。如果您正苦于以下问题:Python ModuleSecurityInfo.declareProtected方法的具体用法?Python ModuleSecurityInfo.declareProtected怎么用?Python ModuleSecurityInfo.declareProtected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AccessControl.SecurityInfo.ModuleSecurityInfo的用法示例。


在下文中一共展示了ModuleSecurityInfo.declareProtected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ModuleSecurityInfo

# 需要导入模块: from AccessControl.SecurityInfo import ModuleSecurityInfo [as 别名]
# 或者: from AccessControl.SecurityInfo.ModuleSecurityInfo import declareProtected [as 别名]
# 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',
                         )

# BBB: for setup tools created with CMF 1.5 if CMFSetup isn't installed
开发者ID:MatthewWilkes,项目名称:Products.GenericSetup,代码行数:33,代码来源:__init__.py

示例2: ModuleSecurityInfo

# 需要导入模块: from AccessControl.SecurityInfo import ModuleSecurityInfo [as 别名]
# 或者: from AccessControl.SecurityInfo.ModuleSecurityInfo import declareProtected [as 别名]
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.SecurityInfo import ModuleSecurityInfo
from Acquisition import Implicit
from App.config import getConfiguration 
from App.special_dtml import DTMLFile
from DateTime.DateTime import DateTime
from OFS.SimpleItem import Item
from OFS.PropertyManager import PropertyManager
from OFS.History import Historical
from OFS.History import html_diff
from Persistence import Persistent

modulesecurity = ModuleSecurityInfo()

modulesecurity.declareProtected('View management screens',
    'manage_addZReSTForm')
manage_addZReSTForm = DTMLFile('dtml/manage_addZReSTForm', globals())

modulesecurity.declareProtected('Add RestructuredText Document', 'manage_addZReST')
def manage_addZReST(self, id, file='', REQUEST=None):
    """Add a ZReST product """
    # validate the instance_home
    self._setObject(id, ZReST(id))
    self._getOb(id).manage_upload(file)
    if REQUEST is not None:
        return self.manage_main(self, REQUEST)

class Warnings:
    def __init__(self):
        self.messages = []
    def write(self, message):
开发者ID:Andyvs,项目名称:TrackMonthlyExpenses,代码行数:34,代码来源:ZReST.py


注:本文中的AccessControl.SecurityInfo.ModuleSecurityInfo.declareProtected方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。