From 9c0996a3c51235e0bd35d2b699e53dea10e81aee Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 20 Mar 2015 02:55:50 +0300 Subject: [PATCH] #465: misprint --- app/controllers/application_controller.rb | 2 +- app/policies/application_policy.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ba3f28555..8cd18ab7d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -47,7 +47,7 @@ class ApplicationController < ActionController::Base # Disables access to site for banned users def banned? - if user_signed_in? && current_user.is_banned? + if user_signed_in? && current_user.access_locked? sign_out current_user flash[:error] = I18n.t('devise.failure.locked') redirect_to root_path diff --git a/app/policies/application_policy.rb b/app/policies/application_policy.rb index 32b617d58..572e95848 100644 --- a/app/policies/application_policy.rb +++ b/app/policies/application_policy.rb @@ -125,14 +125,14 @@ class ApplicationPolicy # # Returns true if he is, false otherwise. def local_reader?(r = record) - owner?(r) || %w(reader writer admin).include? best_role(r) + owner?(r) || %w(reader writer admin).include?(best_role(r)) end # Private: Check if provided user is at least record writer. # # Returns true if he is, false otherwise. def local_writer?(r = record) - owner?(r) || %w(writer admin).include? best_role(r) + owner?(r) || %w(writer admin).include?(best_role(r)) end # Private: Check if provided user is record owner.