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/e/r/erp5-HEAD/product/CMFCategory/CategoryTool.py   erp5(Download)
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl import Unauthorized, getSecurityManager
from Acquisition import aq_base, aq_inner
from Products.ERP5Type import Permissions
            try:
              if not validate(container, container, key, obj):
                raise Unauthorized('unauthorized access to element %s' % key)
            except Unauthorized:
              # if user can't access object try to return default passed

src/s/l/slapos.core-HEAD/master/bt5/slapos_cloud/ExtensionTemplateItem/SlapOSSecurity.py   slapos.core(Download)
from AccessControl.SecurityManagement import getSecurityManager, \
             setSecurityManager, newSecurityManager
from AccessControl import Unauthorized
 
def getComputerSecurityCategory(self, base_category_list, user_name, 
  if shadow_document.getPortalType() not in ('Person', 'Software Instance',
      'Computer'):
    raise Unauthorized("%s portal type %r is not supported" % (relative_url,
      shadow_document.getPortalType()))
  else:
    reference = shadow_document.getReference()
    if reference is None:
      raise Unauthorized('%r is not configured' % relative_url)
    real_user = acl_users.getUserById(reference)
    if real_user is None:
      raise Unauthorized('%s is not loggable user' % relative_url)
    sm = getSecurityManager()
    shadow_user = acl_users.getUserById('SHADOW-' + reference)
    if shadow_user is None:
      raise Unauthorized('Shadow of %s is not loggable user' % relative_url)

src/c/o/collective.tablepage-0.8a1/collective/tablepage/browser/view.py   collective.tablepage(Download)
# -*- coding: utf-8 -*-
 
import uuid
from AccessControl import Unauthorized
from AccessControl import getSecurityManager
            # load an existing row
            if not self.check_manager_or_mine_record(self.row_index):
                raise Unauthorized("You can't modify that record")
            else:
                self.data = self.storage[self.row_index]
                index = form.get('row-index')
                if not self.check_manager_or_mine_record(index):
                    raise Unauthorized("You can't modify that record")
                to_be_saved['__uuid__'] = storage[index]['__uuid__']
                storage.update(index, to_be_saved)
                if not sm.checkPermission(config.MANAGE_TABLE, context) \
                            and member.getId()!=storage[index-c].get('__creator__'):
                        raise Unauthorized("You can't delete that record")
                tp_catalog.uncatalog_row(context, storage[index-c].get('__uuid__'))
                del storage[index-c]

src/e/r/erp5-HEAD/product/ERP5/mixin/document.py   erp5(Download)
##############################################################################
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo, Unauthorized
from Products.ERP5Type import Permissions
from OFS.Image import Pdata
      is_allowed = method(format=format, **kw)
    if not is_allowed:
      raise Unauthorized('Document: user does not have enough permission'\
                         ' to access document in %s format' %\
                                                        (format or 'original'))

src/e/r/erp5-HEAD/product/ERP5/Document/Alarm.py   erp5(Download)
from compiler.consts import CO_VARKEYWORDS
from DateTime import DateTime
from AccessControl import ClassSecurityInfo, Unauthorized
from AccessControl.SecurityManagement import getSecurityManager, \
            setSecurityManager, newSecurityManager
      checkPermission = portal_membership.checkPermission
      if not checkPermission(Permissions.ManagePortal, self):
        raise Unauthorized('fixing problems or activating a disabled alarm is not allowed')
 
    # Use UnrestrictedMethod, so that the behaviour would not

src/c/o/collective.langMailHost-0.3.5/collective/langMailHost/tool.py   collective.langMailHost(Download)
from Products.CMFCore.utils import getToolByName
from collective.langMailHost.interfaces import ILangCharset
from AccessControl import ClassSecurityInfo, Unauthorized
from Products.CMFPlone.RegistrationTool import (
    RegistrationTool,
    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."))

src/p/r/Products.CMFPlone-5.0a2/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/c/o/collective.languagemovefolders-1.1/src/collective/languagemovefolders/utils.py   collective.languagemovefolders(Download)
# -*- coding: utf-8 -*-
from AccessControl import getSecurityManager
from AccessControl import Unauthorized
from Products.CMFCore.permissions import ModifyPortalContent
import logging
        error = 'You need ModifyPortalContent permissionto execute some_\
                function'
        raise Unauthorized(error)
 
    portal_languages = portal.portal_languages

src/p/r/Products.CMFPlone-5.0a2/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/e/r/erp5-HEAD/bt5/erp5_upgrader/ExtensionTemplateItem/portal_components/extension.erp5.ERP5UpgraderCompatibility.py   erp5(Download)
from Products.ERP5Type.Cache import CachingMethod
from App.config import getConfiguration
from AccessControl import Unauthorized
 
import os
  """
  if ".." in relative_path or relative_path.startswith("/"):
    raise Unauthorized("In Relative Path, you cannot use .. or startwith / for security reason.")
 
  instance_home = getConfiguration().instancehome

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