Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 0abf02bb2abda94c2db99ef2a28c8a2c > files > 790

python-AppTools-3.3.2-1.fc13.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 ######################################################################