<commit_before>function (newDoc, oldDoc, userCtx) {
  function forbidden(message) {    
    throw({forbidden : message});
  };
  
  function unauthorized(message) {
    throw({unauthorized : message});
  };

  if (userCtx.roles.indexOf('_admin') == -1) {
    // admin can edit anything, only check when not admin...
    if (newDoc._deleted) 
      forbidden("You may not delete a doc.");     
  }
};<commit_msg>Only admins may edit this database.<commit_after>function (newDoc, oldDoc, userCtx) {
  function forbidden(message) {    
    throw({forbidden : message});
  };
  
  function unauthorized(message) {
    throw({unauthorized : message});
  };

  if (userCtx.roles.indexOf('_admin') == -1) {
    // only admins can edit or add anything...
      forbidden("You may not edit this database.");     
  }
};
{'fraction_non_alphanumeric': 0.14444444444444443, 'fraction_numerical': 0.0024691358024691358, 'mean_word_length': 3.0753768844221105, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4367248', 'n_tokens_mistral': 251, 'n_tokens_neox': 252, 'n_words': 65}