diff options
| author | Robin Munn <robin.munn@gmail.com> | 2006-09-20 08:40:46 +0000 |
|---|---|---|
| committer | Robin Munn <robin.munn@gmail.com> | 2006-09-20 08:40:46 +0000 |
| commit | 8afc419b123f315d724cbefdbc4c07f0982627a9 (patch) | |
| tree | 1bb5852d588606bbd98f9e4432b55a0bd8fbb42f /django/contrib/admin/views/auth.py | |
| parent | 70e05817910d5fe757a3a235252ef7c12e058676 (diff) | |
sqlalchemy: Merged revisions 3724 to 3769 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/sqlalchemy@3770 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/admin/views/auth.py')
| -rw-r--r-- | django/contrib/admin/views/auth.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/contrib/admin/views/auth.py b/django/contrib/admin/views/auth.py index d09075c2a1..42230050cc 100644 --- a/django/contrib/admin/views/auth.py +++ b/django/contrib/admin/views/auth.py @@ -1,3 +1,4 @@ +from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django import forms, template @@ -5,6 +6,8 @@ from django.shortcuts import render_to_response from django.http import HttpResponseRedirect def user_add_stage(request): + if not request.user.has_perm('auth.change_user'): + raise PermissionDenied manipulator = UserCreationForm() if request.method == 'POST': new_data = request.POST.copy() @@ -37,3 +40,4 @@ def user_add_stage(request): 'opts': User._meta, 'username_help_text': User._meta.get_field('username').help_text, }, context_instance=template.RequestContext(request)) +user_add_stage = staff_member_required(user_add_stage) |
