Skip to content

Commit

Permalink
Rename before_filter :check_admin to :check_authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
subelsky committed Jul 27, 2017
1 parent 052f53b commit 1ce40da
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 171 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def clear_search_index

attr_accessor :users, :contexts

def check_admin
def check_authorization
redirect_to(root_url) unless current_user.try(:admin?)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/assignments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class AssignmentsController < ApplicationController
before_filter :check_admin
before_filter :check_authorization
before_action :set_assignment, only: [:show, :edit, :update, :destroy]
before_action :next_image

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/meta_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class MetaController < ApplicationController
before_filter :check_admin, only: [:create, :edit, :update, :destroy]
before_filter :check_authorization, only: [:create, :edit, :update, :destroy]
before_action :set_metum, only: [:show, :edit, :update, :destroy]

# GET /meta
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/statuses_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class StatusesController < ApplicationController
before_filter :check_admin, only: [:create, :edit, :update, :destroy]
before_filter :check_authorization, only: [:create, :edit, :update, :destroy]
before_action :set_status, only: [:show, :edit, :update, :destroy]

# GET /statuses
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class UsersController < ApplicationController
before_filter :check_admin
before_filter :check_authorization
before_action :set_user, only: [:show, :edit, :update, :destroy]
respond_to :html, :json

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/websites_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class WebsitesController < ApplicationController
before_action :check_admin, only: %i[new edit update destroy]
before_action :check_authorization, only: %i[new edit update destroy]
before_action :set_website, only: %i[show edit update destroy check_count]
before_action :set_strategies_collection, only: %i[new edit]

Expand Down
165 changes: 0 additions & 165 deletions db/schema.rb

This file was deleted.

0 comments on commit 1ce40da

Please sign in to comment.