You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hui Zhang edited this page Oct 12, 2015
·
5 revisions
In config/initializer/stats_admin.rb, use constraint to make sure only accessible to user in certain group
Sufia::StatsAdmin def self.matches?(request) current_user = request.env['warden'].user return false if current_user.blank? current_user.groups.include? 'umg/up.dlt.scholarsphere-admin-viewers' end end
the route to Sufia:StatsAdmin is defined in config/routes.rb,
if defined?(Sufia::StatsAdmin) namespace :admin do constraints Sufia::StatsAdmin do get 'stats' => 'stats#index', as: :stats end end end