<commit_before>var Settings = require('../../js/settings')
var DemoData = require('../data/DemoData')
var Parse = require('parse/node')
var Roles = require('./Roles')
var useMasterKey = {useMasterKey: true}
var colors = require('colors')
var Helpers = require('./Helpers')

function createInitialAdmin(){
  console.log('\nCreating initial admin user...'.bold);
  adminUser = new Parse.User()
  adminUser.set("username", Settings.users[0].user)
  adminUser.set("password", <PASSWORD>[0].<PASSWORD>)
  adminUser.set("email", Settings.users[0].user)
  return adminUser.signUp(null)
    .then(setAdminACL)
    .then(function(adminUser){
      return Roles.getRole('admin')
    })
    .then(function(adminRole){
      adminRole.getUsers().add(adminUser)
      return adminRole.save(null, useMasterKey)
    })
    .then(function(){
      console.log('Initial admin user created'.green);
    })
    .fail(function(err){
      console.log('Initial admin user already exists'.yellow);<commit_msg>add missing useMasterKey flag for creating admin user<commit_after>var Settings = require('../../js/settings')
var DemoData = require('../data/DemoData')
var Parse = require('parse/node')
var Roles = require('./Roles')
var useMasterKey = {useMasterKey: true}
var colors = require('colors')
var Helpers = require('./Helpers')

function createInitialAdmin(){
  console.log('\nCreating initial admin user...'.bold);
  adminUser = new Parse.User()
  adminUser.set("username", Settings.users[0].user)
  adminUser.set("password", <PASSWORD>[<PASSWORD>)
  adminUser.set("email", Settings.users[0].user)
  return adminUser.signUp(null, useMasterKey)
    .then(setAdminACL)
    .then(function(adminUser){
      return Roles.getRole('admin')
    })
    .then(function(adminRole){
      adminRole.getUsers().add(adminUser)
      return adminRole.save(null, useMasterKey)
    })
    .then(function(){
      console.log('Initial admin user created'.green);
    })
    .fail(function(err){
      console.log('Initial admin user already exists'.yellow);
{'fraction_non_alphanumeric': 0.16246913580246913, 'fraction_numerical': 0.0024691358024691358, 'mean_word_length': 4.248704663212435, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2198480', 'n_tokens_mistral': 615, 'n_tokens_neox': 611, 'n_words': 125}