<commit_before>package controllers;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import models.Colony;
import models.Hive;
import models.HiveRecord;
import models.QueenColor;
import models.Race;
import models.User;
import models.Util;
import play.data.Form;
import play.data.FormFactory;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.Security;
import views.html.records.*;

@Security.Authenticated(Secured.class)
public class HiveRecords extends Controller {
  @Inject FormFactory formFactory;
  
  public Result index() {
    List<Colony> colonies = Colony.find.query().where().eq("user", Util.getUser()).order().asc("id").findList();
    
    return ok(index.render(colonies));
  }
  
  public Result show(Long id) {
    Colony colony = Colony.find.byId(id);
    <commit_msg>fix colony visibility<commit_after>package controllers;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import models.Colony;
import models.Hive;
import models.HiveRecord;
import models.QueenColor;
import models.Race;
import models.User;
import models.Util;
import play.data.Form;
import play.data.FormFactory;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.Security;
import views.html.records.*;

@Security.Authenticated(Secured.class)
public class HiveRecords extends Controller {
  @Inject FormFactory formFactory;
  
  public Result index() {
    List<Colony> colonies = Colony.find.query().where().eq("user", Util.getUser()).order().asc("id").findList();
    
    return ok(index.render(colonies));
  }
  
  public Result show(Long id) {
    Colony colony = Colony.find.byId(id);
    
    if(colony != null && !colony.user.equals(Util.getUser())) {
      return badRequest("Dieses Volk gehört Dir nicht.");
    }
    
{'fraction_non_alphanumeric': 0.12796469939327082, 'fraction_numerical': 0.0, 'mean_word_length': 4.581538461538462, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5373348', 'n_tokens_mistral': 576, 'n_tokens_neox': 576, 'n_words': 129}