Commit 2933921d authored by mgabdev's avatar mgabdev

Fixed issue with group_serializer current_user exists

• Fixed:
- issue with group_serializer current_user exists
parent 1955ee66
......@@ -16,7 +16,11 @@ class REST::GroupSerializer < ActiveModel::Serializer
end
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
else
nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment