mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[per-object-permissions] Fixes another problem when using one-to-one relations and POPs
git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
20ca1751dc
commit
aa6725cb07
@ -692,9 +692,12 @@ class ChangeList(object):
|
||||
def get_query_set(self):
|
||||
if (not self.opts.admin.show_all_rows) and self.opts.row_level_permissions and (not self.user.has_perm(self.opts.app_label + "."+self.opts.get_change_permission())):
|
||||
from django.contrib.auth.models import RowLevelPermission
|
||||
qs = self.manager.filter(id__in=RowLevelPermission.objects.get_model_list(self.user,
|
||||
model_id_name = self.opts.pk.attname
|
||||
param_name = model_id_name.replace("_", "__")+"__in"
|
||||
param = {param_name:RowLevelPermission.objects.get_model_list(self.user,
|
||||
self.model,
|
||||
self.opts.get_change_permission()))
|
||||
self.opts.get_change_permission())}
|
||||
qs = self.manager.filter(**param)
|
||||
else:
|
||||
qs = self.manager.get_query_set()
|
||||
lookup_params = self.params.copy() # a dictionary of the query string
|
||||
|
Loading…
x
Reference in New Issue
Block a user