0

I would like to be able to check in my code whether a user has access to the Wagtail admin interface. I was imagining a field on the Django model like user.is_wagtail_user.

Is there an existing way to do this? Or is there something simple I can add?

MDalt
  • 1,681
  • 2
  • 24
  • 46

1 Answers1

0

Access to the Wagtail admin is controlled by the standard Django permission system, with a permission named wagtailadmin.access_admin. This can be checked with the has_perm method:

user.has_perm('wagtailadmin.access_admin')

gasman
  • 23,691
  • 1
  • 38
  • 56