<commit_before>/* global Buffer, exports, require, setTimeout */

const assert = require('assert').strict;
const log4js = require('log4js');
const httpLogger = log4js.getLogger('http');
const settings = require('../../utils/Settings');
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
const readOnlyManager = require('../../db/ReadOnlyManager');

hooks.deprecationNotices.authFailure = 'use the authnFailure and authzFailure hooks instead';

const staticPathsRE = new RegExp('^/(' + [
  'api/.*',
  'favicon\\.ico',
  'javascripts/.*',
  'locales\\.json',
  'pluginfw/.*',
  'static/.*',
].join('|') + ')$');

exports.normalizeAuthzLevel = (level) => {
  if (!level) return false;
  switch (level) {
    case true:
      return 'create';
    case 'readOnly':<commit_msg>webaccess: Use a non-capturing regex group<commit_after>/* global Buffer, exports, require, setTimeout */

const assert = require('assert').strict;
const log4js = require('log4js');
const httpLogger = log4js.getLogger('http');
const settings = require('../../utils/Settings');
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
const readOnlyManager = require('../../db/ReadOnlyManager');

hooks.deprecationNotices.authFailure = 'use the authnFailure and authzFailure hooks instead';

const staticPathsRE = new RegExp('^/(?:' + [
  'api/.*',
  'favicon\\.ico',
  'javascripts/.*',
  'locales\\.json',
  'pluginfw/.*',
  'static/.*',
].join('|') + ')$');

exports.normalizeAuthzLevel = (level) => {
  if (!level) return false;
  switch (level) {
    case true:
      return 'create';
    case 'readOnly':
{'fraction_non_alphanumeric': 0.19266625233064014, 'fraction_numerical': 0.0037290242386575512, 'mean_word_length': 4.278688524590164, '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': '3850864', 'n_tokens_mistral': 519, 'n_tokens_neox': 526, 'n_words': 118}