diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/auth/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 7b7dee78fc..f41ece7ce8 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -79,6 +79,11 @@ class Permission(models.Model): def __str__(self): return "%s | %s" % (self.content_type, self.name) + @property + def user_perm_str(self): + """String representation for the user permission check.""" + return f"{self.content_type.app_label}.{self.codename}" + def natural_key(self): return (self.codename, *self.content_type.natural_key()) |
