fixed privileged? method
This commit is contained in:
parent
965d7b701e
commit
6f03b75f00
|
@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
|
|||
before_filter :configure_permitted_parameters, if: :devise_controller?
|
||||
|
||||
def privileged?(user)
|
||||
(current_user == user || current_user.admin?) ? true : false
|
||||
(current_user && (current_user == user || current_user.admin?)) ? true : false
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -47,6 +47,6 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def privileged?(user)
|
||||
(current_user == user || current_user.admin?) ? true : false
|
||||
(current_user && (current_user == user || current_user.admin?)) ? true : false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue