def show_team(request):
"""
Show team.
Only available to organization owners.
---
org_id:
description: The team's org id
type: string
required: true
team_id:
description: The team's id
type: string
"""
auth_context = auth_context_from_request(request)
org_id = request.matchdict['org_id']
team_id = request.matchdict['team_id']
# SEC check if owner
if not (auth_context.org and auth_context.is_owner()
and auth_context.org.id == org_id):
raise OrganizationAuthorizationFailure()
# Check if team entry exists
try:
team = auth_context.org.get_team_by_id(team_id)
except me.DoesNotExist:
raise TeamNotFound()
return team.as_dict()
# SEC
评论列表
文章目录