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.