routes.rb revision 2d8fa234ee3a19af707818a46ad42a5a7887d3a9
require 'resque/server'
auth_resque = ->(request) {
request.env['warden'].authenticate? and request.env['warden'].user.admin?
}
Ontohub::Application.routes.draw do
devise_for :users, :controllers => { :registrations => "users/registrations" }
resources :users, :only => :show
resources :keys, except: [:show, :edit, :update]
resources :logics do
resources :supports, :only => [:create, :update, :destroy, :index]
resources :graphs, :only => [:index]
end
resources :languages do
resources :supports, :only => [:create, :update, :destroy, :index]
end
resources :language_mappings
resources :logic_mappings
resource :links
resources :language_adjoints
resources :logic_adjoints
resources :serializations
namespace :admin do
resources :teams, :only => :index
resources :users
resources :jobs, :only => :index
end
constraints auth_resque do
mount Resque::Server, :at => "/admin/resque"
end
resources :teams do
resources :permissions, :only => [:index], :controller => 'teams/permissions'
resources :team_users, :only => [:index, :create, :update, :destroy], :path => 'users'
end
get 'autocomplete' => 'autocomplete#index'
get 'symbols' => 'search#index'
resources :repositories do
resources :ssh_access, :only => :index
resources :permissions, :only => [:index, :create, :update, :destroy]
resources :ontologies, only: [:index, :show, :edit, :update] do
resources :children, :only => :index
resources :entities, :only => :index
resources :sentences, :only => :index
resources :ontology_versions, :only => [:index, :show, :new, :create], :path => 'versions' do
resource :oops_request, :only => [:show, :create]
end
resources :metadata, :only => [:index, :create, :destroy]
resources :comments, :only => [:index, :create, :destroy]
resources :graphs, :only => [:index]
end
resources :files, only: [:new, :create]
# action: history, diff, entries_info, files
get ':ref/:action(/:path)',
controller: :files,
as: :ref,
constraints: { path: /.*/ }
end
get ':repository_id(/:path)',
controller: :files,
action: :files,
as: :repository_tree,
constraints: { path: /.*/ }
root :to => 'home#show'
end