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.ZMIntrospection-0.3.0/Products/ZMIntrospection/__init__.py   Products.ZMIntrospection(Download)
def introspection(self):
    secman = getSecurityManager()
    if not secman.checkPermission("Manage properties", self.this()):
        raise Unauthorized("Permission denied")
 
    from App.Management import Tabs
    from OFS.SimpleItem import Item
    from AccessControl import getSecurityManager, Unauthorized
 
    def filtered_manage_options(self, REQUEST=None):

src/c/o/collective.cover-1.0a8.post1/src/collective/cover/tiles/list.py   collective.cover(Download)
# -*- coding: utf-8 -*-
 
from AccessControl import Unauthorized
from collective.cover import _
from collective.cover.interfaces import ICoverUIDsProvider
    def populate_with_uids(self, uuids):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to add content to this tile'))
        self.set_limit()
    def replace_with_objects(self, uids):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to add content to this tile'))
        self.set_limit()

src/c/o/collective.cover-1.0a8.post1/src/collective/cover/tiles/base.py   collective.cover(Download)
# http://davisagli.com/blog/using-tiles-to-provide-more-flexible-plone-layouts
 
from AccessControl import Unauthorized
from Acquisition import aq_base
from Acquisition import aq_inner
    def populate_with_object(self, obj):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to add content to this tile'))
 
    def remove_item(self, uid):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to remove content of this tile'))

src/o/p/opencore-listen-0.8.0/Products/listen/browser/import_export.py   opencore-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(_(u'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(_(u'Cannot export mailing list archives'))
                # reuse the import permission here
                if not self.can(ImportMailingListArchives):
                    raise Unauthorized(_(u'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(_(u'Cannot import mailing list archives'))
            file = self.request.form.get("import_file")
            if file:

src/w/i/wildcard.foldercontents-2.0a7/wildcard/foldercontents/views.py   wildcard.foldercontents(Download)
# XXX This is all ripped out of plone.app.toolbar
 
import transaction
from AccessControl import Unauthorized
from AccessControl import getSecurityManager
        sm = getSecurityManager()
        if not sm.checkPermission(_permissions[factory_name], self.context):
            raise Unauthorized('You do not have permission to use this '
                               'vocabulary')
        factory = queryUtility(IVocabularyFactory, factory_name)

src/b/i/bika.lims-3.01a/bika/lims/jsonapi/create.py   bika.lims(Download)
from AccessControl import getSecurityManager
from AccessControl import Unauthorized
from bika.lims.idserver import renameAfterCreation
from bika.lims.jsonapi import set_fields_from_request
from bika.lims.jsonapi import resolve_request_lookup
            msg = "You don't have the '{0}' permission on {1}".format(
                AccessJSONAPI, parent.absolute_url())
            raise Unauthorized(msg)
 
        obj_id = request.get("obj_id", "")

src/c/o/collective.cover-HEAD/src/collective/cover/tiles/list.py   collective.cover(Download)
# -*- coding: utf-8 -*-
 
from AccessControl import Unauthorized
from collective.cover import _
from collective.cover.interfaces import ICoverUIDsProvider
    def populate_with_uids(self, uuids):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to add content to this tile'))
        self.set_limit()
    def replace_with_objects(self, uids):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to add content to this tile'))
        self.set_limit()

src/c/o/collective.cover-HEAD/src/collective/cover/tiles/base.py   collective.cover(Download)
# http://davisagli.com/blog/using-tiles-to-provide-more-flexible-plone-layouts
 
from AccessControl import Unauthorized
from Acquisition import aq_base
from Acquisition import aq_inner
    def populate_with_object(self, obj):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to add content to this tile'))
 
    def remove_item(self, uid):
        if not self.isAllowedToEdit():
            raise Unauthorized(
                _('You are not allowed to remove content of this tile'))

src/p/r/Products.Silva-3.0.4/Products/Silva/Ghost/views.py   Products.Silva(Download)
# Zope 2
from AccessControl import getSecurityManager
from AccessControl import Unauthorized
 
# Silva
        if not getSecurityManager().checkPermission(permission, haunted):
            raise Unauthorized(
                u"You do not have permission to "
                u"see the target of this ghost")
        view = queryMultiAdapter((haunted, self.request), name="content.html")

src/b/i/Bika-LIMS-HEAD/bika/lims/jsonapi/create.py   Bika-LIMS(Download)
from AccessControl import getSecurityManager
from AccessControl import Unauthorized
from bika.lims.idserver import renameAfterCreation
from bika.lims.jsonapi import set_fields_from_request
from bika.lims.jsonapi import resolve_request_lookup
            msg = "You don't have the '{0}' permission on {1}".format(
                AccessJSONAPI, parent.absolute_url())
            raise Unauthorized(msg)
 
        obj_id = request.get("obj_id", "")

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