Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(837)  |  Call(179)  |  Derive(1)  |  Import(657)

src/s/i/silva.core.views-3.0.2/src/silva/core/views/views.py   silva.core.views(Download)
 
from AccessControl.security import checkPermission
from AccessControl import Unauthorized
 
from five import grok
                if not checkPermission('silva.ReadSilvaContent', self.context):
                    raise Unauthorized(
                        "You need to be authenticated to access this version")
            if content is None:
                content = self.context.get_viewable()

src/c/o/collective.editskinswitcher-3.1/collective/editskinswitcher/traversal.py   collective.editskinswitcher(Download)
import logging
 
from AccessControl import Unauthorized, getSecurityManager
from Products.CMFCore.utils import getToolByName
from zope.component import queryUtility
def check_auth(request):
    if anonymous(request):
        raise Unauthorized('Go away')
 
 

src/p/l/plone.dexterity-2.2.3/plone/dexterity/utils.py   plone.dexterity(Download)
from Acquisition import aq_base
from Acquisition import aq_inner
from AccessControl import Unauthorized
from DateTime import DateTime
 
        fti = getUtility(IDexterityFTI, name=object.portal_type)
        if not fti.isConstructionAllowed(container):
            raise Unauthorized("Cannot create %s" % object.portal_type)
 
        if container_fti is not None and not container_fti.allowType(object.portal_type):

src/p/l/plone.dexterity-HEAD/plone/dexterity/utils.py   plone.dexterity(Download)
from Acquisition import aq_base
from Acquisition import aq_inner
from AccessControl import Unauthorized
from DateTime import DateTime
 
        fti = getUtility(IDexterityFTI, name=object.portal_type)
        if not fti.isConstructionAllowed(container):
            raise Unauthorized("Cannot create %s" % object.portal_type)
 
        if container_fti is not None and not container_fti.allowType(object.portal_type):

src/d/j/django-sis-HEAD/appy/fields/ref.py   django-sis(Download)
        may = self.mayAdd(obj)
        if not may:
            from AccessControl import Unauthorized
            raise Unauthorized("User can't write Ref field '%s' (%s)." % \
                               (self.name, may.msg))

src/p/l/plone.app.contenttypes-1.2a3/plone/app/contenttypes/setuphandlers.py   plone.app.contenttypes(Download)
# -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from Acquisition import aq_base, aq_inner
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import bodyfinder
        fti = getUtility(IDexterityFTI, name=object.portal_type)
        if not fti.isConstructionAllowed(container):
            raise Unauthorized("Cannot create %s" % object.portal_type)
 
        if container_fti is not None and \

src/p/l/plone.app.contenttypes-HEAD/plone/app/contenttypes/setuphandlers.py   plone.app.contenttypes(Download)
# -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from Acquisition import aq_base, aq_inner
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import bodyfinder
        fti = getUtility(IDexterityFTI, name=object.portal_type)
        if not fti.isConstructionAllowed(container):
            raise Unauthorized("Cannot create %s" % object.portal_type)
 
        if container_fti is not None and \

src/p/l/plone.app.tiles-1.0.1/plone/app/tiles/browser/base.py   plone.app.tiles(Download)
from zope.component import getMultiAdapter
from zope.security import checkPermission
 
from AccessControl import Unauthorized
 
            if not checkPermission(self.tileType.add_permission, self.context):
                raise Unauthorized(
                    "You are not allowed to add this kind of tile")
 
        super(TileForm, self).update()

src/h/a/haufe.monitoring-0.2.1.4/haufe/monitoring/network.py   haufe.monitoring(Download)
import logging
from ipcalc import IP, Network
from AccessControl import Unauthorized
 
LOG = logging.getLogger('haufe.monitoring')
        msg = 'Access prohibited (IP=%s)%' % remote_ip
        LOG.error(msg)
        raise Unauthorized(msg)
 
 

src/c/2/c2.patch.plone3mail-1.0b1/c2/patch/plone3mail/HotfixRegistrationTool.py   c2.patch.plone3mail(Download)
from zope.component import getUtility
from zope.i18nmessageid import MessageFactory
from AccessControl import Unauthorized
from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import getToolByName
def _mailPassword(self, forgotten_userid, REQUEST):
    """ Wrapper around mailPassword """
    membership = getToolByName(self, 'portal_membership')
    if not membership.checkPermission('Mail forgotten password', self):
        raise Unauthorized(_(u"Mailing forgotten passwords has been disabled."))

Previous  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13  Next