MCPcopy
hub / github.com/django/django / has_module_permission

Method has_module_permission

django/contrib/admin/options.py:668–679  ·  view source on GitHub ↗

Return True if the given request has any permission in the given app label. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module's

(self, request)

Source from the content-addressed store, hash-verified

666 )
667
668 def has_module_permission(self, request):
669 """
670 Return True if the given request has any permission in the given
671 app label.
672
673 Can be overridden by the user in subclasses. In such case it should
674 return True if the given request has permission to view the module on
675 the admin index page and access the module's index page. Overriding it
676 does not restrict access to the add, change or delete views. Use
677 `ModelAdmin.has_(add|change|delete)_permission` for that.
678 """
679 return request.user.has_module_perms(self.opts.app_label)
680
681
682class ModelAdmin(BaseModelAdmin):

Callers 1

_build_app_dictMethod · 0.45

Calls 1

has_module_permsMethod · 0.45

Tested by

no test coverage detected