From d775c625bb96d4d59380275c48c8e4f3a04b4e43 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 20 Mar 2020 03:13:53 -0500 Subject: [PATCH] application controller: remove role_only! methods. --- app/controllers/application_controller.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8d8157615..b5f8ebdf5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -165,17 +165,6 @@ class ApplicationController < ActionController::Base raise User::PrivilegeError if !request.get? && IpBan.is_banned?(CurrentUser.ip_addr) end - def role_only!(role) - raise User::PrivilegeError if !CurrentUser.send("is_#{role}?") - raise User::PrivilegeError if !request.get? && CurrentUser.user.is_banned? - end - - User::Roles.each do |role| - define_method("#{role}_only") do - role_only!(role) - end - end - def pundit_user [CurrentUser.user, request] end