<commit_before>const find = require('lodash/find');
const isNull = require('lodash/isNull');
const project = require('src/contexts/project');
const authApi = require('src/core/auth');
const { effect } = require('src/utils');
const { authConf } = require('src/auth-utils');
const { NotImplementedError, AuthorizationError } = require('src/errors');


function createAccess(teamId, permission) {
  return access(permission)
    .then(effect(v => {
      if (isNull(v)) throw new NotImplementedError();
    }));
}


function removeAccess(teamId, id, {auth}) {
  return authApi.teams.get(teamId, {conf: authConf(auth)})
    .then(({data: {permissions}}) => find(permissions, {id}))<commit_msg>Parse permission ids as ints when finding them for deletion<commit_after>const find = require('lodash/find');
const isNull = require('lodash/isNull');
const project = require('src/contexts/project');
const authApi = require('src/core/auth');
const { effect } = require('src/utils');
const { authConf } = require('src/auth-utils');
const { NotImplementedError, AuthorizationError } = require('src/errors');


function createAccess(teamId, permission) {
  return access(permission)
    .then(effect(v => {
      if (isNull(v)) throw new NotImplementedError();
    }));
}


function removeAccess(teamId, id, {auth}) {
  return authApi.teams.get(teamId, {conf: authConf(auth)})
    .then(({data: {permissions}}) => find(permissions, {id: +id}))
{'fraction_non_alphanumeric': 0.16934919524142758, 'fraction_numerical': 0.0, 'mean_word_length': 5.529680365296803, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2458025', 'n_tokens_mistral': 447, 'n_tokens_neox': 437, 'n_words': 99}