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)
| 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 | |
| 682 | class ModelAdmin(BaseModelAdmin): |
no test coverage detected