Skip to content

Commit

Permalink
Back out of Stat dashboard and default permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-bernhardt committed Aug 8, 2024
1 parent a6b88fa commit 493a3c3
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 34 deletions.
4 changes: 0 additions & 4 deletions app/controllers/admin/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ def authorize_user
end

def authorize_action?(resource, action)
Rails.logger.info '================ Checking papers...'
Rails.logger.info "=== Confirming #{action} on #{resource}"
Rails.logger.info "=== Result: #{can? action, resource}"

can? action, resource
end

Expand Down
10 changes: 0 additions & 10 deletions app/controllers/admin/stats_controller.rb

This file was deleted.

5 changes: 0 additions & 5 deletions app/dashboards/stat_dashboard.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def initialize(user)
return unless user.present?
# Rules will go here.

can :index, StatDashboard

return unless user.admin?
can :manage, :all
end
Expand Down
9 changes: 0 additions & 9 deletions app/views/admin/stats/index.html.erb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/layouts/_site_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<nav class="local-nav" aria-label="Main menu">
<%= nav_link_to("Home", root_path) %>
<% if user_signed_in? %>
<% if can? :index, StatDashboard %>
<% if can? :index, Term %>
<%= link_to('Admin', admin_root_path, class: 'nav-item') %>
<% end %>
<% end %>
Expand Down
5 changes: 2 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
end

namespace :admin do
resources :stats, only: [:index]

namespace :detector do
resources :suggested_resources
end

resources :search_events
resources :terms

resources :users

root to: "stats#index"
root to: "terms#index"
end

post '/graphql', to: 'graphql#execute'
Expand Down

0 comments on commit 493a3c3

Please sign in to comment.