Permalink
Browse files

[per-object-permissions] Fixed a bug where delete row level permissio…

…n 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
  • Loading branch information...
Christopher Long
Christopher Long committed Aug 24, 2006
1 parent 7b2e379 commit 5d37e5cd4c42e5dd831f927fd94329cb5c613d83
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/contrib/admin/views/row_level_permissions.py
@@ -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()

0 comments on commit 5d37e5c

Please sign in to comment.