def get(self, request, client_user_string, functionality_group_id):
"""
Is the specified user allowed to use the functionality?
Returns `{ "enabled": true }` if the specified ClientUser is allowed to use the
functionality group, ``{ "enabled": false }`` if the user is disallowed, or a 404 error if
functionality group does not exist.
Include a string that uniquely identifies the user as the client user string.
See also the `which` endpoint to see if a user has a specific functionality group within a
functionality
"""
functionality_group = get_object_or_404(Functionality, id=functionality_group_id)
client_user = ClientUser.user_from_object(client_user_string)
return Response({'enabled': can_i_use(client_user, functionality_group)})
评论列表
文章目录