<commit_before>package com.softwaremill.codebrag.service.data

import com.softwaremill.codebrag.domain.{UserSettings, User}
import org.bson.types.ObjectId

case class UserJson(id: String, login: String, fullName: String, email:String, token: String, settings: UserSettings) {
  def idAsObjectId = new ObjectId(id)
}

object UserJson {
  def apply(user: User) = {
    new UserJson(user.id.toString, user.authentication.username, user.name, user.emailLowerCase, user.token, user.settings)
  }

  def apply(list: List[User]): List[UserJson] = {
    for (user <- list) yield UserJson(user)
  }
}<commit_msg>Expose admin flag to UI<commit_after>package com.softwaremill.codebrag.service.data

import com.softwaremill.codebrag.domain.{UserSettings, User}
import org.bson.types.ObjectId

case class UserJson(id: String, login: String, fullName: String, email:String, token: String, admin: Boolean, settings: UserSettings) {
  def idAsObjectId = new ObjectId(id)
}

object UserJson {
  def apply(user: User) = {
    new UserJson(user.id.toString, user.authentication.username, user.name, user.emailLowerCase, user.token, user.admin, user.settings)
  }

  def apply(list: List[User]): List[UserJson] = {
    for (user <- list) yield UserJson(user)
  }
}
{'fraction_non_alphanumeric': 0.12379421221864952, 'fraction_numerical': 0.0, 'mean_word_length': 5.073170731707317, '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': '5741551', 'n_tokens_mistral': 414, 'n_tokens_neox': 404, 'n_words': 97}