MCPcopy
hub / github.com/django/django / get_model_perms

Method get_model_perms

django/contrib/admin/options.py:825–836  ·  view source on GitHub ↗

Return a dict of all perms for this model. This dict has the keys ``add``, ``change``, ``delete``, and ``view`` mapping to the True/False for each of those actions.

(self, request)

Source from the content-addressed store, hash-verified

823 return forms.Media(js=["admin/js/%s" % url for url in js])
824
825 def get_model_perms(self, request):
826 """
827 Return a dict of all perms for this model. This dict has the keys
828 ``add``, ``change``, ``delete``, and ``view`` mapping to the True/False
829 for each of those actions.
830 """
831 return {
832 "add": self.has_add_permission(request),
833 "change": self.has_change_permission(request),
834 "delete": self.has_delete_permission(request),
835 "view": self.has_view_permission(request),
836 }
837
838 def _get_form_for_get_fields(self, request, obj):
839 return self.get_form(request, obj, fields=None)

Callers 1

_build_app_dictMethod · 0.80

Calls 4

has_add_permissionMethod · 0.45
has_change_permissionMethod · 0.45
has_delete_permissionMethod · 0.45
has_view_permissionMethod · 0.45

Tested by

no test coverage detected