<commit_before>Rails.application.routes.draw do

  controller :authentication do
    get 'login' => :new
    post 'login' => :create
    delete 'logout' => :destroy
  end

  scope 'u/:slug', controller: :profiles do
    get '/' => :show, as: :user_profile
  end

  namespace :admin do
    resources :agents, :browsers, only: [:index, :show] do
      member do
        post 'toggle'
        put 'lock'
        delete 'lock', action: :unlock
      end
    end

    resources :codes, only: [:index, :show]
    resources :tokens, only: [:index, :show] do
      member do
        post 'toggle'
      end
    end

    resources :editable_pages, only: [:index, :show]

    resources :metrics, only: [:index, :show]

    resources :privileges, only: [:index, :show] do
      member do
        put 'lock', defaults: { format: :json }
        delete 'lock', action: :unlock, defaults: { format: :json }
        post 'priority', defaults: { format: :json }
        post 'toggle', defaults: { format: :json }
        get 'users'
        put 'users/:user_id' => :add_user, as: :user, defaults: { format: :json }
        delete 'users/:user_id' => :remove_user, defaults: { format: :json }
      end
    end
    resources :privilege_groups, only: [:index, :show] do
      member do
        put 'privileges/:privilege_id' => :add_privilege, as: :privilege, defaults: { format: :json }
        delete 'privileges/:privilege_id' => :remove_privilege, defaults: { format: :json }
      end
    end
  end

  namespace :my do
    get '/' => 'index#index'

    resource :profile, except: [:destroy]
    resource :confirmation, :recovery, only: [:show, :create, :update]
  end

  resources :agents, :browsers, except: [:index, :show]

  resources :editable_pages, except: [:index, :show]

  resources :users, except: [:index, :show]
  resources :tokens, :codes, except: [:index, :show]

  resources :metrics, only: [:edit, :update]

  resources :privileges, except: [:index, :show]
  resources :privilege_groups, except: [:index, :show]
end
<commit_msg>Routes for managing users<commit_after>Rails.application.routes.draw do

  controller :authentication do
    get 'login' => :new
    post 'login' => :create
    delete 'logout' => :destroy
  end

  scope 'u/:slug', controller: :profiles do
    get '/' => :show, as: :user_profile
  end

  namespace :admin do
    get '/' => 'index#index'

    resources :agents, :browsers, only: [:index, :show] do
      member do
        post 'toggle'
        put 'lock'
        delete 'lock', action: :unlock
      end
    end

    resources :codes, only: [:index, :show]
    resources :tokens, only: [:index, :show] do
      member do
        post 'toggle'
      end
    end

    resources :editable_pages, only: [:index, :show]

    resources :metrics, only: [:index, :show]

    resources :privileges, only: [:index, :show] do
      member do
        put 'lock', defaults: { format: :json }
        delete 'lock', action: :unlock, defaults: { format: :json }
        post 'priority', defaults: { format: :json }
        post 'toggle', defaults: { format: :json }
        get 'users'
        put 'users/:user_id' => :add_user, as: :user, defaults: { format: :json }
        delete 'users/:user_id' => :remove_user, defaults: { format: :json }
      end
    end
    resources :privilege_groups, only: [:index, :show] do
      member do
        put 'privileges/:privilege_id' => :add_privilege, as: :privilege, defaults: { format: :json }
        delete 'privileges/:privilege_id' => :remove_privilege, defaults: { format: :json }
      end
    end

    resources :users, only: [:index, :show] do
      member do
        get 'tokens'
        get 'codes'
        get 'privileges'
      end
    end
  end

  namespace :my do
    get '/' => 'index#index'

    resource :profile, except: [:destroy]
    resource :confirmation, :recovery, only: [:show, :create, :update]
  end

  resources :agents, :browsers, except: [:index, :show]

  resources :editable_pages, except: [:index, :show]

  resources :users, except: [:index, :show]
  resources :tokens, :codes, except: [:index, :show]

  resources :metrics, only: [:edit, :update]

  resources :privileges, except: [:index, :show]
  resources :privilege_groups, except: [:index, :show]
end

{'fraction_non_alphanumeric': 0.1415804327375353, 'fraction_numerical': 0.0, 'mean_word_length': 2.9054178145087235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, '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': '3550360', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1383, 'n_words': 425}