'Set the default permission to be used by all subsequent
:term:`view configuration` registrations.  ``permission``
should be a :term:`permission` string to be used as the
default permission.  An example of a permission
string:``\'view\'``.  Adding a default permission makes it
unnecessary to protect each view configuration with an
explicit permission, unless your application policy requires
some exception for a particular view.
If a default permission is *not* set, views represented by
view configuration registrations which do not explicitly
declare a permission will be executable by entirely anonymous
users (any authorization policy is ignored).
Later calls to this method override will conflict with earlier calls;
there can be only one default permission active at a time within an
application.
.. warning::
If a default permission is in effect, view configurations meant to
create a truly anonymously accessible view (even :term:`exception
view` views) *must* use the value of the permission importable as
:data:`pyramid.security.NO_PERMISSION_REQUIRED`.  When this string
is used as the ``permission`` for a view configuration, the default
permission is ignored, and the view is registered, making it
available to all callers regardless of their credentials.
.. seealso::
See also :ref:`setting_a_default_permission`.
.. note::
Using the ``default_permission`` argument to the
:class:`pyramid.config.Configurator` constructor can be used to
achieve the same purpose.'

@action_method
def set_default_permission(self, permission):

    def register():
        self.registry.registerUtility(permission, IDefaultPermission)
    intr = self.introspectable('default    permission', None, permission, 'default    permission')
    intr['value'] = permission
    perm_intr = self.introspectable('permissions', permission, permission, 'permission')
    perm_intr['value'] = permission
    self.action(IDefaultPermission, register, order=PHASE1_CONFIG, introspectables=(intr, perm_intr))
