Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > c567edd4605b914c84d9dab4c41a8a5b > files > 611

python-enthought-apptools-3.3.0-2mdv2010.0.noarch.rpm

"""The secured DebugView for the permissions framework example."""


# Enthought library imports.
from enthought.pyface.workbench.debug.api import DebugView
from enthought.permissions.api import SecureProxy

# Local imports.
from permissions import DebugViewPerm


class SecuredDebugView(DebugView):
    """A secured DebugView."""
    
    ###########################################################################
    # 'IWorkbenchPart' interface.
    ###########################################################################

    def create_control(self, parent):
        """Reimplemented to secure the created control."""

        control = DebugView.create_control(self, parent)

        return SecureProxy(control, permissions=[DebugViewPerm])

#### EOF ######################################################################