def is_staff(connection, window_info, kwargs):
    """restrict a WS signal or a WS function to staff users

    >>> @signal(is_allowed_to=is_staff)
    ... def my_signal(request, arg1=None):
    ...     # noinspection PyUnresolvedReferences
    ...     print(request, arg1)
    """
    return window_info and window_info.is_staff