Return True if the given request has permission to delete the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request ha
(self, request, obj=None)
| 628 | return request.user.has_perm("%s.%s" % (opts.app_label, codename)) |
| 629 | |
| 630 | def has_delete_permission(self, request, obj=None): |
| 631 | """ |
| 632 | Return True if the given request has permission to delete the given |
| 633 | Django model instance, the default implementation doesn't examine the |
| 634 | `obj` parameter. |
| 635 | |
| 636 | Can be overridden by the user in subclasses. In such case it should |
| 637 | return True if the given request has permission to delete the `obj` |
| 638 | model instance. If `obj` is None, this should return True if the given |
| 639 | request has permission to delete *any* object of the given type. |
| 640 | """ |
| 641 | opts = self.opts |
| 642 | codename = get_permission_codename("delete", opts) |
| 643 | return request.user.has_perm("%s.%s" % (opts.app_label, codename)) |
| 644 | |
| 645 | def has_view_permission(self, request, obj=None): |
| 646 | """ |
no test coverage detected