Move abilities for admin views in separate model
This commit is contained in:
parent
815b9e6e14
commit
54aa82dcd1
6 changed files with 676 additions and 572 deletions
|
|
@ -2,6 +2,12 @@ module Admin
|
|||
class BaseController < ApplicationController
|
||||
before_filter :verify_user_admin
|
||||
|
||||
private
|
||||
|
||||
def current_ability
|
||||
@current_ability ||= AdminAbility.new(current_user)
|
||||
end
|
||||
|
||||
def verify_user_admin
|
||||
if (current_user.nil?)
|
||||
redirect_to sign_in_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue