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.subscribemember-1.11/collective/subscribemember/browser/renew.py   collective.subscribemember(Download)
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SpecialUsers import system
from DateTime import DateTime
                                    logging.info(log)
                                finally:
                                    setSecurityManager(sm)
                            else:
                                msg = "The membership for %s hasn't expired" % memberid

src/r/t/rt.lastmodifier-0.3.1/rt/lastmodifier/browser/lastmodifier.py   rt.lastmodifier(Download)
from plone.app.layout.viewlets.content import ContentHistoryViewlet
from AccessControl.User import SimpleUser, UnrestrictedUser
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager, getSecurityManager
from Products.CMFCore.utils import getToolByName
 
                    return full_history[0].get('actorid') or full_history[0].get('actor').get('username')
        finally:
            setSecurityManager(old_sm)
 
 

src/p/r/Products.remember-1.9.3/Products/remember/utils.py   Products.remember(Download)
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SpecialUsers import system as system_user
 
            newSecurityManager(None, system_user)
            value = fn(*args, **kwargs)
            setSecurityManager(orig_sec_mgr)
        return value
    return trusted_fn

src/c/o/collective.zamqp-HEAD/src/collective/zamqp/consumer.py   collective.zamqp(Download)
import grokcore.component as grok
 
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import getSecurityManager
    def __exit__(self, type, value, traceback):
        if self.user:
            setSecurityManager(self.old_security_manager)
 
 

src/p/r/Products.remember-1.9.3/Products/remember/content/member.py   Products.remember(Download)
                return None
        finally:
            SecurityManagement.setSecurityManager(orig_sm)
 
        if self.verifyCredentials(credentials):

src/c/o/collective.validator.xhtmlStrict-1.2.0/collective/validator/xhtmlStrict/adapter.py   collective.validator.xhtmlStrict(Download)
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, \
    setSecurityManager
from Products.ATContentTypes.content.document import ATDocument
from Products.ATContentTypes.content.event import ATEvent
        old_security_manager= getSecurityManager()
        if self.context.getAnonymousValidation():
            setSecurityManager(None)
        results = self.search()
        setSecurityManager(old_security_manager)
            obj = brain.getObject()
            if self.context.getAnonymousValidation():
                setSecurityManager(None)
            if shasattr(obj,'view'):
                validation = self.getValidationResults(obj.view().encode('utf-8'))
                    except:
                        view= obj.unrestrictedTraverse('base_view')()
            setSecurityManager(old_security_manager)
 
            validation=self.getValidationResults(view.encode('utf-8'))

src/e/r/erp5-HEAD/product/ERP5eGovSecurity/EGOVUserManager.py   erp5(Download)
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager,\
    setSecurityManager, newSecurityManager
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
                  return login, login # use same for user_id and login
              finally:
                setSecurityManager(sm)
            else:
              if pw_validate(user.getPassword(), password):
            raise _SWALLOWABLE_PLUGIN_EXCEPTIONS[0]
          finally:
            setSecurityManager(sm)
          # XXX: Here, we filter catalog result list ALTHOUGH we did pass
          # parameters to unrestrictedSearchResults to restrict result set.

src/e/r/erp5-HEAD/product/ERP5Wizard/PAS/ERP5RemoteUserManager.py   erp5(Download)
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager,\
    setSecurityManager, newSecurityManager
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
                return login, login
            finally:
              setSecurityManager(sm)
 
            raise _AuthenticationFailure()

src/e/r/erp5-HEAD/product/ERP5ShortMessage/Document/EssendexGateway.py   erp5(Download)
from AccessControl import ClassSecurityInfo, \
                          Unauthorized 
from AccessControl.SecurityManagement import  getSecurityManager, \
                                              setSecurityManager, \
                                              newSecurityManager 
      finally:
        #Restore orinal user
        setSecurityManager(sm)
 
 

src/e/r/erp5-HEAD/product/ERP5/Tool/InotifyTool.py   erp5(Download)
from Products.ERP5Type import Permissions
from Products.ERP5.mixin.timer_service import TimerServiceMixin
from AccessControl.SecurityManagement import newSecurityManager, \
  getSecurityManager, setSecurityManager
 
                getattr(notify, notify.getSenseMethodId())(events)
          finally:
            setSecurityManager(original_security_manager)
 
        if update_state_dict:

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