Skip to content

Commit

Permalink
only show readers admin screens to admins and site designers
Browse files Browse the repository at this point in the history
  • Loading branch information
jadehopepunk committed Mar 19, 2013
1 parent 25d33b1 commit 54d71ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/controllers/admin/groups_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
class Admin::GroupsController < Admin::ResourceController
only_allow_access_to :index, :show, :new, :create, :edit, :update, :remove, :destroy, :settings,
:when => :admin,
:denied_url => { :controller => 'pages', :action => 'index' },
:denied_message => 'You must be an administrator to add or modify readers'

helper :reader
paginate_models
skip_before_filter :load_model
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/admin/messages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
class Admin::MessagesController < Admin::ResourceController
only_allow_access_to :index, :show, :new, :create, :edit, :update, :remove, :destroy, :settings,
:when => :admin,
:denied_url => { :controller => 'pages', :action => 'index' },
:denied_message => 'You must be an administrator to add or modify readers'

helper :reader
skip_before_filter :load_model
before_filter :load_model, :except => :index # we want the filter to run before :show too
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/admin/reader_configuration_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
class Admin::ReaderConfigurationController < Admin::ConfigurationController
helper :reader

only_allow_access_to :index, :show, :new, :create, :edit, :update, :remove, :destroy, :settings,
:when => :admin,
:denied_url => { :controller => 'pages', :action => 'index' },
:denied_message => 'You must be an administrator to add or modify readers'

end
2 changes: 1 addition & 1 deletion app/controllers/admin/readers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Admin::ReadersController < Admin::ResourceController
helper :reader
paginate_models

only_allow_access_to :new, :create, :edit, :update, :remove, :destroy, :settings,
only_allow_access_to :index, :show, :new, :create, :edit, :update, :remove, :destroy, :settings,
:when => :admin,
:denied_url => { :controller => 'pages', :action => 'index' },
:denied_message => 'You must be an administrator to add or modify readers'
Expand Down

0 comments on commit 54d71ca

Please sign in to comment.