def get(self, request, client_user_string, functionality_group_id):
"""
Which Flavor of the given Functionality is enabled for the user, if any?
Returns `{ "which": "<app.group.functionality>" }` that corresponds to the ClientUser's
enabled functionality, or `{ "which": none }` if the user does not have any Flavor in
the given FuncationlityGroup.
If the Functionality does not exist, this endpoint returns a 404 error.
"""
functionality_group = get_object_or_404(Functionality, id=functionality_group_id)
client_user = ClientUser.user_from_object(client_user_string)
availability = which(client_user, functionality_group)
return Response({
'functionality': availability.flavor.__str__() if availability else None,
})
评论列表
文章目录