sets the security handler
549636
def securityHandler(self, value):
        
        if isinstance(value, abstract.BaseSecurityHandler):
            if isinstance(value, security.AGOLTokenSecurityHandler):
                self._securityHandler = value
                self._token = value.token
                self._username = value.username
                self._password = value._password
                self._token_url = value.token_url
            elif isinstance(value, security.OAuthSecurityHandler):
                self._token = value.token
                self._securityHandler = value
            else:
                pass
551278
def set_server_callback(self, handle):
        
        if self.on_events:
            for event in self.on_events:
                handle.on_event(event, self.on_event)
        if self.on_changes:
            for change in self.on_changes:
                if change in ['patching', 'streaming']:
                    # Patch and stream events do not need handling on server
                    continue
                handle.on_change(change, self.on_change)
240977
public void setSessionHandler(SessionHandler sessionHandler) {
        handler.setSessionsEnabled(sessionHandler != null);
        handler.setSessionHandler(sessionHandler);
    }
672927
function setExceptionHandler(callable $handler)
    {
        $ExceptionHandler = new TransferHandle;
        $ExceptionHandler->setWhoopsHandle($handler);
        $this->container->set(SysConst::HTTP_EXCEPTION_HANDLER, $ExceptionHandler);
    }
496593
def enable_rights(self):
        
        if self.rights is None:
            handler_instance = RightsHandler(self)
            self.handlers.insert(len(self.default_handlers), handler_instance)
171997
public function handler()
    {
        if ($this->allow_public_access) {
            Container::resolve_method($this, 'handle');
            return;
        }

        if (empty($this->restrict_to_roles) || \in_array(User_Utils::get_user_role()->name, $this->restrict_to_roles)) {
            Container::resolve_method($this, 'handle');
            return;
        }

        \wp_send_json_error('You do not have sufficient permissions to perform this action', 403);
    }
751612
public function setErrorHandler()
    {
        set_error_handler(function ($errno, $errstr, $errfile, $errline ) {
            throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
        });
    }
840670
protected function setRememberMeCookie(): void
	{
		if($this->options['cookie_options']['secure'] && !$this->request->isSecure())
		{
			throw new RuntimeException('Attempted to set a secure cookie over a non-secure connection.');
		}

		$this->response->getCookies()->addSigned($this->options['auth_key'], $this->user->getAccessToken(), (3600 * 24 * 365), $this->options['cookie_options']);
	}
138647
def handle_security(controller, im_self=None):
    
    if controller._pecan.get('secured', False):
        check_permissions = controller._pecan['check_permissions']

        if isinstance(check_permissions, six.string_types):
            check_permissions = getattr(
                im_self or six.get_method_self(controller),
                check_permissions
            )

        if not check_permissions():
            raise exc.HTTPUnauthorized
857123
private void addHttpSessionIdListener(HttpSessionIdListener listener, boolean securityCheckNeeded) throws SecurityException {
        if (securityCheckNeeded) {
            SecurityManager sm = System.getSecurityManager();
            if (sm != null) {
                sm.checkPermission(perm);
            }
        }
        
        ((IHttpSessionContext31)this.getSessionContext()).addHttpSessionIdListener(listener, name);
    }
1024258
def set_ssl_logging(self, enable=False, func=_ssl_logging_cb):
        
        '''
        if enable:
            SSL_CTX_set_info_callback(self._ctx, func)
        else:
            SSL_CTX_set_info_callback(self._ctx, 0)
415694
def _update_handler(self, handler_class, level):
        """"""
        handler = self._get_handler(handler_class)
        handler.setLevel(level)
497187
function setBeforeRouteChangeHandler(handler) {
            if (null == handler) {
                return _beforeRouteChange;
            }
            else {
                var oldHandler = _beforeRouteChange;
                _beforeRouteChange = handler;
                return oldHandler;
            }
        }
439875
public static LinkedBindingBuilder<HandlerWrapper> bindSecurityHandler(final Binder binder)
    {
        return binder.bind(HandlerWrapper.class).annotatedWith(SECURITY_NAMED);
    }
685394
function setDatabaseSecurity(name, cb) {
  // Get _security first
  getSecurity(name, function(err, d) {
    if(err) return cb(err)
    
    // Make name an admin
    if(d.admins.names.indexOf(name) === -1) {
      d.admins.names.push(name)
    }
    
    // Make name a reader
    if(d.readers.names.indexOf(name) === -1) {
      d.readers.names.push(name)
    }
    
    // Merge with _security template
    d = mergeSecurity(_security, d)
    
    // Apply changes
    setSecurity(name, d, function(err) {
      if(err) return cb(err)
      cb()
    })
  })
}
319825
def init_handler(self):
        
        assert self.options.get('host') and self.options.get('port'), "Invalid options"
        assert self.options.get('to'), 'Recipients list is empty. SMTP disabled.'
        if not isinstance(self.options['to'], (list, tuple)):
            self.options['to'] = [self.options['to']]
94861
function Handler() {
    if (this.constructor === Handler) {
        throw new Error("Can't instantiate abstract class!");
    }

    /**
     * @var {Object}
     * @protected
     */
    this.__inspector;

    /**
     * @var {Object}
     * @protected
     */
    this.__run;

    /**
     * @var {Object}
     * @protected
     */
    this.__request = null;

    /**
     * @var {Object}
     * @protected
     */
    this.__response = null;
}