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
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user