'Add a forbidden view to the current configuration state.  The
view will be called when Pyramid or application code raises a
:exc:`pyramid.httpexceptions.HTTPForbidden` exception and the set of
circumstances implied by the predicates provided are matched.  The
simplest example is:
.. code-block:: python
def forbidden(request):
return Response(\'Forbidden\', status=\'403 Forbidden\')
config.add_forbidden_view(forbidden)
If ``view`` argument is not provided, the view callable defaults to
:func:`~pyramid.httpexceptions.default_exceptionresponse_view`.
All arguments have the same meaning as
:meth:`pyramid.config.Configurator.add_view` and each predicate
argument restricts the set of circumstances under which this forbidden
view will be invoked.  Unlike
:meth:`pyramid.config.Configurator.add_view`, this method will raise
an exception if passed ``name``, ``permission``, ``require_csrf``,
``context``, ``for_``, or ``exception_only`` keyword arguments. These
argument values make no sense in the context of a forbidden
:term:`exception view`.
.. versionadded:: 1.3
.. versionchanged:: 1.8
The view is created using ``exception_only=True``.'

@viewdefaults
@action_method
def add_forbidden_view(self, view=None, attr=None, renderer=None, wrapper=None, route_name=None, request_type=None, request_method=None, request_param=None, containment=None, xhr=None, accept=None, header=None, path_info=None, custom_predicates=(), decorator=None, mapper=None, match_param=None, **view_options):

    for arg in ('name', 'permission', 'context', 'for_', 'require_csrf', 'exception_only'):
        if (arg in view_options):
            raise ConfigurationError(('%s    may    not    be    used    as    an    argument    to    add_forbidden_view' % (arg,)))
    if (view is None):
        view = default_exceptionresponse_view
    settings = dict(view=view, context=HTTPForbidden, exception_only=True, wrapper=wrapper, request_type=request_type, request_method=request_method, request_param=request_param, containment=containment, xhr=xhr, accept=accept, header=header, path_info=path_info, custom_predicates=custom_predicates, decorator=decorator, mapper=mapper, match_param=match_param, route_name=route_name, permission=NO_PERMISSION_REQUIRED, require_csrf=False, attr=attr, renderer=renderer)
    settings.update(view_options)
    return self.add_view(**settings)
