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.contentrules.yearmonth-1.1/collective/contentrules/yearmonth/target_folder.py   collective.contentrules.yearmonth(Download)
                                       transition=transition)
        finally:
            SecurityManagement.setSecurityManager(old_sm)
        return folder
 

src/p/r/Products.PloneFlashUpload-1.3/src/Products/PloneFlashUpload/browser.py   Products.PloneFlashUpload(Download)
        result = "filename=%s" %f.getId()
 
        SecurityManagement.setSecurityManager(old_sm)
 
        return result

src/c/o/collective.contemplate-0.1/src/collective/contemplate/login.py   collective.contemplate(Download)
        source.manage_copyObjects([template.getId()]))
    container.manage_renameObject(result['new_id'], id_)
    SecurityManagement.setSecurityManager(sm)
 
    added = container[id_]

src/e/r/erp5-HEAD/product/ERP5eGovSecurity/EGOVGroupManager.py   erp5(Download)
 
from Products.ERP5Type.Globals import InitializeClass
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/ERP5/mixin/extensible_traversable.py   erp5(Download)
from Products.ERP5Type.Cache import getReadOnlyTransactionCache
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
from Products.ERP5Type import Permissions
from Products.CMFCore.utils import getToolByName, _setCacheHeaders, _ViewEmulator
    # restore original security context if there's a logged in user
    if user is not None:
      setSecurityManager(old_manager)
    if document is not None:
      document = aq_base(document.asContext(id=name, # Hide some properties to permit locating the original
    # restore original security context if there's a logged in user
    if user is not None:
      setSecurityManager(old_manager)
    return document
 

src/f/t/ftw.publisher.core-2.4.0/ftw/publisher/core/adapters/backreferences.py   ftw.publisher.core(Download)
from AccessControl.SecurityInfo import ClassSecurityInformation
from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import SpecialUsers
            references = referenceable.getBackReferenceImpl()
        finally:
            setSecurityManager(old_security_manager)
 
        for ref in references:

src/e/r/erp5-HEAD/product/ERP5/InteractionWorkflow.py   erp5(Download)
from types import StringTypes
from AccessControl import getSecurityManager, ClassSecurityInfo
from AccessControl.SecurityManagement import setSecurityManager
from Acquisition import aq_base
from Products.CMFCore.utils import getToolByName
        # between here and when the interaction was executed... So we
        # need to switch to the security manager as it was back then
        setSecurityManager(security_manager)
        self.scripts[script_name](sci)
      finally:
        setSecurityManager(current_security_manager)

src/f/t/ftw.notification.base-1.2.4/ftw/notification/base/vocabularies.py   ftw.notification.base(Download)
        except:
            AccessControl.SecurityManagement.setSecurityManager(
                _old_security_manager)
            raise
        else:
            AccessControl.SecurityManagement.setSecurityManager(
                _old_security_manager)

src/f/t/ftw.file-1.8.1/ftw/file/viewlets/content_history.py   ftw.file(Download)
            except:
                AccessControl.SecurityManagement.setSecurityManager(
                    _old_security_manager)
                raise
            else:
                AccessControl.SecurityManagement.setSecurityManager(
                    _old_security_manager)

src/p/l/plone.app.multilingual-2.0a2/devel/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):

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