1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

[per-object-permissions] Fixed a bug where delete row level permission was giving a PermissionDenied error falsely. (Missed adding the file to the commit)

git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3656 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Christopher Long 2006-08-24 16:08:13 +00:00
parent 7b2e3798f4
commit 5d37e5cd4c

View File

@ -124,12 +124,14 @@ def delete_row_level_permission(request, app_label, model_name, object_id, ct_id
ct = rlp.model_ct
obj = rlp.model
if model_instance.id is not obj.id:
if not (model_instance.id == rlp.model_id):
raise PermissionDenied
if not request.user.has_perm(rlp._meta.app_label + '.' + rlp._meta.get_delete_permission()):
print "BAM"
raise PermissionDenied
if not request.user.has_perm(obj._meta.app_label + '.' + obj._meta.get_change_permission(), object=obj):
print "BOOM"
raise PermissionDenied
rlp.delete()