Fixed issue with group fetching, serializer for loading password
• Fixed: - issue with group fetching, serializer for loading password for admin only
This commit is contained in:
parent
7c952a1e06
commit
8f57514bc8
@ -61,7 +61,7 @@ class Api::V1::GroupsController < Api::BaseController
|
||||
end
|
||||
|
||||
def show
|
||||
render json: @group, serializer: REST::GroupSerializer
|
||||
render json: @group, serializer: REST::GroupSerializer, individual_group: true
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -20,11 +20,15 @@ class REST::GroupSerializer < ActiveModel::Serializer
|
||||
return nil
|
||||
end
|
||||
|
||||
if instance_options[:individual_group]
|
||||
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
|
||||
object.password
|
||||
else
|
||||
nil
|
||||
end
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def group_category
|
||||
|
Loading…
Reference in New Issue
Block a user