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/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/Portal.py   Products.CMFPlone(Download)
from AccessControl import ClassSecurityInfo
from AccessControl import Permissions
from AccessControl import Unauthorized
from Acquisition import aq_base
from App.class_init import InitializeClass
            if not _checkPermission(permissions.DeleteObjects, item):
                raise Unauthorized(
                    "Do not have permissions to remove this object")
        return CMFSite.manage_delObjects(self, ids, REQUEST=REQUEST)
 

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/PloneFolder.py   Products.CMFPlone(Download)
from Acquisition import aq_parent
from AccessControl import Permissions
from AccessControl import Unauthorized
from AccessControl import ClassSecurityInfo
from ComputedAttribute import ComputedAttribute
            if not mt.checkPermission(Permissions.delete_objects, item):
                raise Unauthorized(
                    "Do not have permissions to remove this object")
        return PortalFolderBase.manage_delObjects(self, ids, REQUEST=REQUEST)
 

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/skins/plone_scripts/object_rename.py   Products.CMFPlone(Download)
from Products.CMFPlone import PloneMessageFactory as _
from Products.CMFCore.utils import getToolByName
from AccessControl import Unauthorized
from Products.PythonScripts.standard import url_quote_plus
 
mtool = getToolByName(context, 'portal_membership')
if not mtool.checkPermission('Copy or Move', context):
    raise Unauthorized(_(u'Permission denied to rename ${title}.',
                         mapping={u'title': title}))
 

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/Portal.py   Products.CMFPlone(Download)
from AccessControl import ClassSecurityInfo
from AccessControl import Permissions
from AccessControl import Unauthorized
from Acquisition import aq_base
from App.class_init import InitializeClass
            if not _checkPermission(permissions.DeleteObjects, item):
                raise Unauthorized(
                    "Do not have permissions to remove this object")
        return CMFSite.manage_delObjects(self, ids, REQUEST=REQUEST)
 

src/e/r/erp5-HEAD/product/ERP5TioSafe/ConnectionPlugin/OxatisConnection.py   erp5(Download)
from lxml import etree
from zLOG import LOG, PROBLEM
from AccessControl import Unauthorized
 
RECORD_NOT_FOUND = "1001"
      return url, xml
    elif error_code == UNAUTHORIZED:
      raise Unauthorized(url)
    elif error_code == ERRORS:
      # Check if there is subcode

src/e/r/erp5-HEAD/product/ERP5/Extensions/Grep.py   erp5(Download)
import re
import cgi
from Acquisition import aq_base
from AccessControl import Unauthorized
from Products.CMFCore.utils import _checkPermission
def grep(self, pattern, A=0, B=0, r=1, i=0, highlight=1, first_occurence=0):
  if not _checkPermission(Permissions.ManagePortal, self):
    raise Unauthorized(self)
  command_line_arguments = {} # emulate grep command line args
  command_line_arguments['A'] = int(A)

src/a/p/appy-0.8.5/appy/gen/mixins/__init__.py   appy(Download)
        userId = user.getId()
        if (page in self.locks) and (userId != self.locks[page][0]):
            from AccessControl import Unauthorized
            raise Unauthorized('This page is locked.')
        # Set the lock
            userId = self.getUser().getId()
            if self.locks[page][0] != userId:
                from AccessControl import Unauthorized
                raise Unauthorized('This page was locked by someone else.')
        # Remove the lock
    def allows(self, permission, raiseError=False):
        '''Has the logged user p_permission on p_self ?'''
        hasPermission = self.getUser().has_permission(permission, self)
        if not hasPermission and raiseError:
            from AccessControl import Unauthorized

src/p/r/Products.PloneHotfix20130618-1.3.1/Products/PloneHotfix20130618/mail_password.py   Products.PloneHotfix20130618(Download)
        from Products.CMFPlone.factory import _IMREALLYPLONE4
    except ImportError:
        from AccessControl import Unauthorized as exc_class
 
 
            # Re-use this ready-translated message for now
            exc = exc_class(
                    _(u"Mailing forgotten passwords has been disabled."))
 
            # Work around bug in mail_password under Py>2.6

src/g/o/gomobile.mobile-1.0.5/gomobile/mobile/browser/resizer.py   gomobile.mobile(Download)
from StringIO import StringIO
 
from AccessControl import Unauthorized
from Acquisition import aq_inner
from zope.app.component.hooks import getSite
 
    if width < 1 or width > safe[0]:
        raise Unauthorized("Invalid width: %d" % width)
 
    if height < 1 or height > safe[1]:
        raise Unauthorized("Invalid height: %d" % height)
            # for testing.
            if override_secret != getSecret():
                raise Unauthorized("Wrong override_secret:" + override_secret)
        else:
            if calculateSignature(**params) != secret:
                raise Unauthorized("Bad image resizer secret:" + str(secret) + " " + str(params))

src/p/r/Products.listen-0.6.4/Products/listen/browser/import_export.py   Products.listen(Download)
from AccessControl import Unauthorized
from BTrees.OOBTree import OOBTree
from Products.CMFCore.utils import getToolByName
from Products.Five import BrowserView
from Products.listen.config import PROJECTNAME
            if export_addresses:
                if not self.can(ExportMailingListSubscribers):
                    raise Unauthorized('Cannot export mailing list subscribers')
                filename = "%s-subscribers.csv" % self.context.getId()
                es = getAdapter(self.context, IMailingListSubscriberExport, name='csv')
                file_data = es.export_subscribers()
            elif export_messages:
                if not self.can(ExportMailingListArchives):
                    raise Unauthorized('Cannot export mailing list archives')
                # reuse the import permission here
                if not self.can(ImportMailingListArchives):
                    raise Unauthorized('Cannot import mailing list archives')
                key = key[len(UNDO_SUBMIT):]
                msg_count = self.undo_import(key)
        if self.request.form.get("import_messages"):
            if not self.can(ImportMailingListArchives):
                raise Unauthorized('Cannot import mailing list archives')
            file = self.request.form.get("import_file")
            if file:

Previous  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next