Ticket #6991: 6991.2.diff
File 6991.2.diff, 3.3 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/views/decorators.py
52 52 member, displaying the login page if necessary. 53 53 """ 54 54 def _checklogin(request, *args, **kwargs): 55 if request.user.is_ authenticated() and request.user.is_staff:55 if request.user.is_staff: 56 56 # The user is valid. Continue to the admin page. 57 57 if 'post_data' in request.POST: 58 58 # User must have re-authenticated through a different window -
django/contrib/admin/templates/admin/base.html
21 21 <div id="branding"> 22 22 {% block branding %}{% endblock %} 23 23 </div> 24 {% if user.is_ authenticated and user.is_staff %}24 {% if user.is_staff %} 25 25 <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div> 26 26 {% endif %} 27 27 {% block nav-global %}{% endblock %} -
django/contrib/admin/sites.py
92 92 Returns True if the given HttpRequest has permission to view 93 93 *at least one* page in the admin site. 94 94 """ 95 return request.user.is_ authenticated() and request.user.is_staff95 return request.user.is_staff 96 96 97 97 def root(self, request, url): 98 98 """ -
django/middleware/doc.py
12 12 indicating the view function. This is used by the documentation module 13 13 to lookup the view function for an arbitrary page. 14 14 """ 15 if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or (request.user.is_authenticated() and request.user.is_staff)):15 if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or request.user.is_staff): 16 16 response = http.HttpResponse() 17 17 response['X-View'] = "%s.%s" % (view_func.__module__, view_func.__name__) 18 18 return response -
docs/authentication.txt
712 712 permission ``polls.can_vote``:: 713 713 714 714 def my_view(request): 715 if not (request.user.is_authenticated() and request.user.has_perm('polls.can_vote')):715 if not request.user.has_perm('polls.can_vote'): 716 716 return HttpResponse("You can't vote in this poll.") 717 717 # ... 718 718