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

All Samples(271)  |  Call(158)  |  Derive(0)  |  Import(113)
install *manager* as current security manager for this thread.

        def setSecurityManager(manager):
    """install *manager* as current security manager for this thread."""
    thread_id=get_ident()
    _managers[thread_id]=manager
        


src/c/o/collective.cron-2.7/src/collective/cron/adapters/ploneappasync.py   collective.cron(Download)
from zope.event import notify
from zope.site.hooks import getSite, setSite
from AccessControl.SecurityManagement import getSecurityManager, setSecurityManager
from zope.annotation.interfaces import IAttributeAnnotatable, IAnnotations
 
                        iqueue.annotations['plone'].pop(idx)
                finally:
                    setSecurityManager(scontext)
                transaction.commit()
        except Exception, ex: # pragma: no cover

src/u/w/uwosh.pfg.d2c-2.4.3/uwosh/pfg/d2c/utils.py   uwosh.pfg.d2c(Download)
from AccessControl import getSecurityManager
from Products.CMFCore.utils import getToolByName
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.User import UnrestrictedUser as BaseUnrestrictedUser
    finally:
        # Restore the old security manager
        setSecurityManager(sm)
 

src/e/e/eea.sparql-3.3/eea/sparql/content/sparql.py   eea.sparql(Download)
from AccessControl import SpecialUsers
from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
 
from zope.interface import implements
                    newSecurityManager(None, SpecialUsers.system)
                    pr.save(obj=self, comment=comment)
                    setSecurityManager(oldSecurityManager)
                except FileTooLargeToVersionError:
                    commands = view.getCommandSet('plone')
                ob.invalidateWorkingResult()
 
        setSecurityManager(oldSecurityManager)
        return ob
 

src/p/l/plone.app.multilingual-HEAD/src/plone/app/multilingual/dx/subscriber.py   plone.app.multilingual(Download)
from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.User import UnrestrictedUser
from Acquisition import aq_parent
        finally:
            # Restore the old security manager
            setSecurityManager(sm)
 
    def reindex_translation(self, translation):

src/f/t/ftw.participation-1.3.1/ftw/participation/setter.py   ftw.participation(Download)
        except:
            AccessControl.SecurityManagement.setSecurityManager(
                _old_security_manager)
            raise
        else:
            AccessControl.SecurityManagement.setSecurityManager(
                _old_security_manager)

src/s/l/slapos.core-HEAD/master/product/SlapOS/SlapOSMachineAuthenticationPlugin.py   slapos.core(Download)
import sys
 
from AccessControl.SecurityManagement import newSecurityManager,\
    getSecurityManager, setSecurityManager
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
                  error = sys.exc_info())
      finally:
        setSecurityManager(sm)
      return tuple(security_group_list)
 

src/e/r/erp5-HEAD/product/ERP5Wizard/Tool/WizardTool.py   erp5(Download)
from UserDict import UserDict
import xmlrpclib, socket, traceback, urllib, urllib2, base64, cgi
from AccessControl.SecurityManagement import setSecurityManager
from Products.ERP5Type.Utils import _setSuperSecurityManager
import zLOG, cookielib
              "Completed installation for %s" %' '.join(bt5_filenames))
    if use_super_manager:
      setSecurityManager(original_security_manager)
 
  ######################################################
    portal_preferences = getToolByName(self, 'portal_preferences')
    preference_value = portal_preferences.getPreference(preference_id, default)
    setSecurityManager(original_security_manager)
    return preference_value
 

src/e/r/erp5-HEAD/product/ERP5/Tool/IntrospectionTool.py   erp5(Download)
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from AccessControl.SecurityManagement import setSecurityManager
from Products.ERP5 import _dtmldir
from Products.ERP5.Tool.LogMixin import LogMixin
    if downgrade_authenticated_user:
      # restore original Security Manager
      setSecurityManager(original_security_manager)
 
    # Unlazyfy URLs and other lazy values so that it can be marshalled
    if downgrade_authenticated_user:
      # restore original Security Manager
      setSecurityManager(original_security_manager)
 
    return erp5_module_list

src/e/a/Easyshop-HEAD/src/easyshop.order/easyshop/order/adapters/order_management.py   Easyshop(Download)
# Zope imports
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.User import UnrestrictedUser as BaseUnrestrictedUser
 
        ## Reset security manager
        setSecurityManager(old_sm)
 
        # Index with customer again

src/p/r/Products.EasyNewsletter-2.6.12/Products/EasyNewsletter/content/EasyNewsletter.py   Products.EasyNewsletter(Download)
from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
from AccessControl.User import UnrestrictedUser as BaseUnrestrictedUser
 
    finally:
        # Restore the old security manager
        setSecurityManager(sm)
 

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