Fixed issue with group_serializer current_user exists
• Fixed: - issue with group_serializer current_user exists
This commit is contained in:
parent
1955ee6602
commit
2933921d04
|
@ -16,7 +16,11 @@ class REST::GroupSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def password
|
def password
|
||||||
if defined?(current_user) && object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
if !defined?(current_user) || current_user.nil?
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
||||||
object.password
|
object.password
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Reference in New Issue