Ticket #8936: options.diff

File options.diff, 2.5 KB (added by Riccardo Di Virgilio, 13 years ago)

django.contrib.admin.options.py

Line 
1206,210c206
2<
3< if self.has_change_permission(request, obj):
4< return self.readonly_fields
5<
6< return flatten_fieldsets(self.declared_fieldsets)
7---
8> return self.readonly_fields
9284,294d279
10<
11< def has_view_permission(self, request, obj=None):
12< """
13< Returns True if the given request has permission to add an object.
14< Can be overriden by the user in subclasses.
15< """
16< opts = self.opts
17<
18< return request.user.has_perm(opts.app_label + '.view_%s' % opts.object_name.lower())
19< #must add a method to opts
20< #return request.user.has_perm(opts.app_label + '.' + opts.has_view_permission())
21367,368c352
22< if not (inline.has_view_permission(request) or
23< inline.has_add_permission(request) or
24---
25> if not (inline.has_add_permission(request) or
26668,677d651
27<
28< def get_list_editable(self, request):
29< """
30< Return a sequence containing the fields to be edited on the
31< changelist.
32< """
33< if self.has_change_permission(request):
34< return self.list_editable
35<
36< return ()
371044,1046c1018,1020
38<
39< if not self.has_view_permission(request, obj):
40< raise PermissionDenied
41---
42>
43> if not self.has_change_permission(request, obj):
44> raise PermissionDenied
451060,1063d1033
46<
47< if not self.has_change_permission(request, obj):
48< raise PermissionDenied
49<
501091,1094d1060
51<
52< if not self.has_view_permission(request, obj):
53< raise PermissionDenied
54<
551144,1145c1110
56<
57< if not self.has_view_permission(request, None):
58---
59> if not self.has_change_permission(request, None):
601147,1149d1111
61<
62< if not self.has_change_permission(request, None) and request.method == "POST":
63< raise PermissionDenied
641153d1114
65< list_editable = self.get_list_editable(request)
661166c1127
67< self.list_per_page, self.list_max_show_all, list_editable,
68---
69> self.list_per_page, self.list_max_show_all, self.list_editable,
701368,1371d1328
71<
72< if not self.has_view_permission(request, obj):
73< raise PermissionDenied
74<
Back to Top