コード例 #1
0
ファイル: __init__.py プロジェクト: bbc/zenoss-prodbin
def listFacades(context=None):
    """
    Provide a list of all known facades.
    """
    if context is None:
        context = get_dmd()
    return sorted(str(name) for name, obj in component.getAdapters([context], IFacade))
コード例 #2
0
def listFacades(context=None):
    """
    Provide a list of all known facades.
    """
    if context is None:
        context = get_dmd()
    return sorted(str(name) for name, obj in component.getAdapters([context], IFacade))
コード例 #3
0
def checkPermission(permission, context=None):
    """
    Return true if the current user has the specified permission on the given
    context or the dmd; otherwise, return false.
    """
    manager = AccessControl.getSecurityManager()
    context = context or get_dmd()
    return manager.checkPermission(permission, context)
コード例 #4
0
ファイル: __init__.py プロジェクト: bbc/zenoss-prodbin
def checkPermission(permission, context=None):
    """
    Return true if the current user has the specified permission on the given
    context or the dmd; otherwise, return false.
    """
    manager = AccessControl.getSecurityManager()
    context = context or get_dmd()
    return manager.checkPermission(permission, context)
コード例 #5
0
def getFacade(name, context=None):
    """
    Get facade by name.  The names are documented in configure.zcml defined as
    utilities that provide subclasses of IFacade (all the subclasses follow
    the naming convention I*Facade). This function hides the use of Zope
    Component Architecture (ZCA) from the Ext Direct routers and other
    consumers of the Zuul Python API.
    """
    if context is None:
        context = get_dmd()
    return component.getAdapter(context, IFacade, name)
コード例 #6
0
ファイル: __init__.py プロジェクト: bbc/zenoss-prodbin
def getFacade(name, context=None):
    """
    Get facade by name.  The names are documented in configure.zcml defined as
    utilities that provide subclasses of IFacade (all the subclasses follow
    the naming convention I*Facade). This function hides the use of Zope
    Component Architecture (ZCA) from the Ext Direct routers and other
    consumers of the Zuul Python API.
    """
    if context is None:
        context = get_dmd()
    return component.getAdapter(context, IFacade, name)