<commit_before>FLOW.userControl = Ember.ArrayController.create({
  sortProperties: null,
  sortAscending: true,
  content: null,
  currentUser: null,
  dataCleaningPaths: null,

  setFilteredContent: function () {
    this.set('content', FLOW.store.filter(FLOW.User, function (item) {
      return true;
    }));
  },

  // load all Survey Groups
  populate: function () {
    FLOW.store.find(FLOW.User);
    this.setFilteredContent();
    this.set('sortProperties', ['userName']);
    this.set('sortAscending', true);
  },

  getSortInfo: function () {
    this.set('sortProperties', FLOW.tableColumnControl.get('sortProperties'));
    this.set('sortAscending', FLOW.tableColumnControl.get('sortAscending'));
    this.set('selected', FLOW.tableColumnControl.get('selected'));
  },

  currentUserPathPermissions: function() {
    return FLOW.currentUser.get('pathPermissions');
  },

  /* return all the ancestor paths for a given path */
  ancestorPaths: function(pathString) {
    if(!pathString) {
        return [];
    }

    var ancestors = [];
    while(pathString) {
        ancestors.push(pathString);
        pathString = pathString.slice(0, pathString.lastIndexOf("/"));
    }
    ancestors.push("/"); // add the root level folder to ancestors list
    return ancestors;
  },

  /* query based on survey (group) ancestorIds whether a user has
  permissions for data deletion */

  canDeleteData: function(ancestorIds) {
    var pathPermissions = this.currentUserPathPermissions();
    var canDelete = false;
    ancestorIds.forEach(function(id){
        if(id in pathPermissions && pathPermissions[id].indexOf("DATA_DELETE") > -1) {
            canDelete = true;
        }
    });
    return canDelete;
  },
});
<commit_msg>[#1124] Remove extra request to `/users` end point<commit_after>FLOW.userControl = Ember.ArrayController.create({
  sortProperties: null,
  sortAscending: true,
  content: null,
  currentUser: null,
  dataCleaningPaths: null,

  setFilteredContent: function () {
    this.set('content', FLOW.store.filter(FLOW.User, function (item) {
      return true;
    }));
  },

  // load all Survey Groups
  populate: function () {
    this.setFilteredContent();
    this.set('sortProperties', ['userName']);
    this.set('sortAscending', true);
  },

  getSortInfo: function () {
    this.set('sortProperties', FLOW.tableColumnControl.get('sortProperties'));
    this.set('sortAscending', FLOW.tableColumnControl.get('sortAscending'));
    this.set('selected', FLOW.tableColumnControl.get('selected'));
  },

  currentUserPathPermissions: function() {
    return FLOW.currentUser.get('pathPermissions');
  },

  /* return all the ancestor paths for a given path */
  ancestorPaths: function(pathString) {
    if(!pathString) {
        return [];
    }

    var ancestors = [];
    while(pathString) {
        ancestors.push(pathString);
        pathString = pathString.slice(0, pathString.lastIndexOf("/"));
    }
    ancestors.push("/"); // add the root level folder to ancestors list
    return ancestors;
  },

  /* query based on survey (group) ancestorIds whether a user has
  permissions for data deletion */

  canDeleteData: function(ancestorIds) {
    var pathPermissions = this.currentUserPathPermissions();
    var canDelete = false;
    ancestorIds.forEach(function(id){
        if(id in pathPermissions && pathPermissions[id].indexOf("DATA_DELETE") > -1) {
            canDelete = true;
        }
    });
    return canDelete;
  },
});

{'fraction_non_alphanumeric': 0.13640287769784173, 'fraction_numerical': 0.002302158273381295, 'mean_word_length': 3.496765847347995, 'pattern_counts': {'":': 0, '<': 3, '<?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': '671300', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1033, 'n_words': 220}