32 lines
897 B
Ruby
32 lines
897 B
Ruby
json.total_count @total_count
|
|
json.members do
|
|
if @current_user_header_team.present?
|
|
json.child! do
|
|
json.partial! 'member', user: current_user
|
|
json.is_owner @project.owner?(current_user)
|
|
case @current_user_header_team.authorize
|
|
when 'read'
|
|
json.role 'Reporter'
|
|
json.role_name t("roles.Reporter")
|
|
when 'write'
|
|
json.role 'Developer'
|
|
json.role_name t("roles.Developer")
|
|
when 'admin'
|
|
json.role 'Manager'
|
|
json.role_name t("roles.Manager")
|
|
when 'owner'
|
|
json.role 'Manager'
|
|
json.role_name t("roles.Manager")
|
|
end
|
|
end
|
|
end
|
|
@members.each do |member|
|
|
json.child! do
|
|
json.partial! 'member', user: member.user
|
|
json.is_owner @project.owner?(member.user)
|
|
json.role member.roles.last.name
|
|
json.role_name t("roles.#{member.roles.last.name}")
|
|
end
|
|
end
|
|
end
|