當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。