diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py
index 33d9a7d..9c11c25 100644
a
|
b
|
from django.conf import settings
|
8 | 8 | from django.contrib.admin.views.decorators import staff_member_required |
9 | 9 | from django.db import models |
10 | 10 | from django.shortcuts import render_to_response |
11 | | from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist |
| 11 | from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist, PermissionDenied |
12 | 12 | from django.http import Http404 |
13 | 13 | from django.core import urlresolvers |
14 | 14 | from django.contrib.admindocs import utils |
… |
… |
def view_detail(request, view):
|
169 | 169 | def model_index(request): |
170 | 170 | if not utils.docutils_is_available: |
171 | 171 | return missing_docutils_page(request) |
172 | | m_list = [m._meta for m in models.get_models()] |
| 172 | m_list = [] |
| 173 | for m in models.get_models(): |
| 174 | if request.user.has_module_perms(m._meta.app_label): |
| 175 | m_list.append(m._meta) |
173 | 176 | return render_to_response('admin_doc/model_index.html', { |
174 | 177 | 'root_path': urlresolvers.reverse('admin:index'), |
175 | 178 | 'models': m_list |
… |
… |
def model_index(request):
|
177 | 180 | |
178 | 181 | @staff_member_required |
179 | 182 | def model_detail(request, app_label, model_name): |
| 183 | if not request.user.has_module_perms(app_label): |
| 184 | raise PermissionDenied |
180 | 185 | if not utils.docutils_is_available: |
181 | 186 | return missing_docutils_page(request) |
182 | 187 | |