I cannot but agree with Kasper, but here is a naive example:
 
@login_required
def create_sale_view(request):
   if request.user.has_perm("sell.add_product"):
       # The user can add new product for sale
   else:
       # The user cannot add new product for sale

https://docs.djangoproject.com/en/4.0/topics/auth/default/#default-permissions
 
 
10.05.2022, 15:06, "Kasper Laudrup" <laud...@stacktrace.dk>:

On 10/05/2022 11.53, DJANGO DEVELOPER wrote:

 yes, I know. but how to use them?
 


The link literally starts with "This document explains the usage of
Django’s authentication system in its default configuration" so it seems
like an obvious place to look in order to figure out "how to use them".

Have you tried reading the documentation?

Kind regards,

Kasper Laudrup
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ab9cf185-708b-607e-5923-b98a1319e130%40stacktrace.dk.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/140831652206599%40mail.yandex.com.

Reply via email to