  -----------
  
  The currently logged-in user's permissions are stored in the template variable
  ``{{ perms }}``. This is an instance of
  :class:`django.core.context_processors.PermWrapper`, which is a
  template-friendly proxy of permissions.
  
  In the ``{{ perms }}`` object, single-attribute lookup is a proxy to
  :meth:`User.has_module_perms <django.contrib.auth.models.User.has_module_perms>`.
  This example would display ``True`` if the logged-in user had any permissions
 
</s> remove       ``django.core.context_processors.PermWrapper``, representing the
 </s> add       ``django.contrib.auth.context_processors.PermWrapper``, representing the </s> remove         * :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise 
          a :class:`~django.contrib.gis.geos.GEOSException` when called 
 </s> add         * :meth:`~django.contrib.gis.geos.GEOSGeometry.transform` will raise
          a :class:`~django.contrib.gis.geos.GEOSException` when called </s> remove # the template system can understand.

class PermLookupDict(object):
    def __init__(self, user, module_name):
        self.user, self.module_name = user, module_name

    def __repr__(self):
        return str(self.user.get_all_permissions())

    def __getitem__(self, perm_name):
        return self.user.has_perm("%s.%s" % (self.module_name, perm_name))

    def __nonzero__(self):
        return self.user.has_module_perms(self.module_name)

class PermWrapper(object):
    def __init__(self, user):
        self.user = user

    def __getitem__(self, module_name):
        return PermLookupDict(self.user, module_name)

    def __iter__(self):
        # I am large, I contain multitudes.
        raise TypeError("PermWrapper is not iterable.")
 </s> add # the template system can understand. They once lived here -- they have
# been moved to django.contrib.auth.context_processors.

from django.contrib.auth.context_processors import PermLookupDict as RealPermLookupDict
from django.contrib.auth.context_processors import PermWrapper as RealPermWrapper

class PermLookupDict(RealPermLookupDict):
    def __init__(self, *args, **kwargs):
        import warnings
        warnings.warn(
            "`django.core.context_processors.PermLookupDict` is " \
            "deprecated; use `django.contrib.auth.context_processors.PermLookupDict` " \
            "instead.",
            PendingDeprecationWarning
        )
        super(PermLookupDict, self).__init__(*args, **kwargs)

class PermWrapper(RealPermWrapper):
    def __init__(self, *args, **kwargs):
        import warnings
        warnings.warn(
            "`django.core.context_processors.PermWrapper` is " \
            "deprecated; use `django.contrib.auth.context_processors.PermWrapper` " \
            "instead.",
            PendingDeprecationWarning
        )
        super(PermWrapper, self).__init__(*args, **kwargs)
:class:`django.contrib.auth.context_processors.PermWrapper`, which is a
  -----------
  
  The currently logged-in user's permissions are stored in the template variable
  ``{{ perms }}``. This is an instance of
:class:`django.contrib.auth.context_processors.PermWrapper`, which is a
  template-friendly proxy of permissions.
  
  In the ``{{ perms }}`` object, single-attribute lookup is a proxy to
  :meth:`User.has_module_perms <django.contrib.auth.models.User.has_module_perms>`.
  This example would display ``True`` if the logged-in user had any permissions
keep keep keep keep replace keep keep keep keep keep
 Fixed #15299 -- Started the process of migrating the auth context processor support classes into the auth context processor module. Thanks to shailesh for the report, and v1v3kn for the draft patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15635 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
docs/topics/auth.txt