Skip to content

Commit

Permalink
Remove reference to request.get_logout_headers()
Browse files Browse the repository at this point in the history
  • Loading branch information
dobesv committed Feb 27, 2014
1 parent dd15238 commit 8b434dd
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pyramid/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ def forget(request):
If no :term:`authentication policy` is in use, this function will
always return an empty sequence.
.. deprecated:: 1.5
Use :meth:`pyramid.request.Request.get_logout_headers` instead.
"""
policy = _get_authentication_policy(request)
if policy is None:
Expand Down Expand Up @@ -354,26 +351,7 @@ def effective_principals(self):
if policy is None:
return [Everyone]
return policy.effective_principals(self)

def get_logout_headers(self):
"""
Return a sequence of header tuples (e.g. ``[('Set-Cookie',
'foo=abc')]``) suitable for 'forgetting' the set of credentials
possessed by the currently authenticated user. A common usage
might look like so within the body of a view function
(``response`` is assumed to be an :term:`WebOb` -style
:term:`response` object computed previously by the view code)::
request.response.headerlist.extend(request.get_logout_headers())

If no :term:`authentication policy` is in use, this function will
always return an empty sequence.
"""
policy = self._get_authentication_policy()
if policy is None:
return []
return policy.forget(request)

class AuthorizationAPIMixin(object):

def has_permission(self, permission, context=None):
Expand Down

0 comments on commit 8b434dd

Please sign in to comment.