<commit_before>package io.tetrapod.core.rpc;

import static io.tetrapod.protocol.core.CoreContract.*;
import io.tetrapod.core.Session;
import io.tetrapod.core.rpc.Structure.Security;
import io.tetrapod.core.utils.*;
import io.tetrapod.core.utils.AuthToken.Decoded;
import io.tetrapod.protocol.core.*;

public class SessionRequestContext extends RequestContext {

   private final static boolean USE_SECURITY = false;
   
   public final Session       session;

   public SessionRequestContext(RequestHeader header, Session session) {
      super(header);
      this.session = session;
   }
   
   @Override
   public Response securityCheck(Request request) {
      if (USE_SECURITY) {
         Security mine = request.getSecurity();
         Security theirs = getSenderSecurity();
         if (theirs.ordinal() < mine.ordinal())
            return Response.error(ERROR_INVALID_RIGHTS);
      }
      return null;
   }
   
   @Override
   public Response securityCheck(Request request, int accountId, String authToken) {
      if (USE_SECURITY) {<commit_msg>turn security back on again<commit_after>package io.tetrapod.core.rpc;

import static io.tetrapod.protocol.core.CoreContract.*;
import io.tetrapod.core.Session;
import io.tetrapod.core.rpc.Structure.Security;
import io.tetrapod.core.utils.*;
import io.tetrapod.core.utils.AuthToken.Decoded;
import io.tetrapod.protocol.core.*;

public class SessionRequestContext extends RequestContext {

   private final static boolean USE_SECURITY = true;
   
   public final Session       session;

   public SessionRequestContext(RequestHeader header, Session session) {
      super(header);
      this.session = session;
   }
   
   @Override
   public Response securityCheck(Request request) {
      if (USE_SECURITY) {
         Security mine = request.getSecurity();
         Security theirs = getSenderSecurity();
         if (theirs.ordinal() < mine.ordinal())
            return Response.error(ERROR_INVALID_RIGHTS);
      }
      return null;
   }
   
   @Override
   public Response securityCheck(Request request, int accountId, String authToken) {
      if (USE_SECURITY) {
{'fraction_non_alphanumeric': 0.0921485660554772, 'fraction_numerical': 0.0, 'mean_word_length': 3.3876288659793814, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2403980', 'n_tokens_mistral': 619, 'n_tokens_neox': 598, 'n_words': 142}