human
Complete this python program:
def check_readonly(view):
assistant
#Here is the Python program you requested.

    """Decorator to enable readonly mode
    """
    def _check_readonly(request, *args, **kwargs):
        if (not flag_is_active(request, 'kumaediting')):
            raise ReadOnlyException('kumaediting')
        elif flag_is_active(request, 'kumabanned'):
            raise ReadOnlyException('kumabanned')
        return view(request, *args, **kwargs)
    return _check_readonly