def user_permissions(request):
    """Return a dictionary of permissions for the current user

    :request: a WSGI request with url data ``resource`` and ``action``.
    """
    auth = request.app.auth
    resources = request.url_data.get('resource', ())
    actions = request.url_data.get('action')
    return auth.get_permissions(request, resources, actions=actions)