MCPcopy
hub / github.com/django/django / has_change_permission

Method has_change_permission

django/contrib/admin/options.py:615–628  ·  view source on GitHub ↗

Return True if the given request has permission to change 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)

Source from the content-addressed store, hash-verified

613 return request.user.has_perm("%s.%s" % (opts.app_label, codename))
614
615 def has_change_permission(self, request, obj=None):
616 """
617 Return True if the given request has permission to change the given
618 Django model instance, the default implementation doesn't examine the
619 `obj` parameter.
620
621 Can be overridden by the user in subclasses. In such case it should
622 return True if the given request has permission to change the `obj`
623 model instance. If `obj` is None, this should return True if the given
624 request has permission to change *any* object of the given type.
625 """
626 opts = self.opts
627 codename = get_permission_codename("change", opts)
628 return request.user.has_perm("%s.%s" % (opts.app_label, codename))
629
630 def has_delete_permission(self, request, obj=None):
631 """

Callers 15

_add_viewMethod · 0.45
user_change_passwordMethod · 0.45
get_formsetMethod · 0.45
formfield_for_dbfieldMethod · 0.45
get_model_permsMethod · 0.45
get_formMethod · 0.45
render_change_formMethod · 0.45
response_addMethod · 0.45
response_deleteMethod · 0.45
get_inline_formsetsMethod · 0.45
_changeform_viewMethod · 0.45

Calls 2

get_permission_codenameFunction · 0.90
has_permMethod · 0.45

Tested by

no test coverage detected