Updated group_serializer to account for no current_user
• Updated: - group_serializer to account for no current_user
This commit is contained in:
parent
b124a5024c
commit
4242f595df
@ -16,7 +16,7 @@ class REST::GroupSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
def password
|
||||
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
||||
if current_user && 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