read only if authenticated, no access otherwise permission scheme

2019-02-22 Thread Balazs Szemes
Hi, I'm trying to implement a simple authentications scheme with 3 groups: 1. no read or write access to AnonymousUser 2. read only for authenticated users 3. read and write for superusers (or staff users) This is similar to using IsAuthenticated or IsAuthenticatedOrReadOnly, but those are not

multipart

2019-02-22 Thread Rosa Amelia OcaƱa
hi, i have a problem posting multipart formdata to djangorest I find a way to post array of objects to django throw multipart data: formdata.append('array[i]object_key', value) but i don't know how to send an empty array and djangorest not recognizes the default way: formdata.append('a

i am facing problem in nested ed serializer

2019-02-22 Thread ANIL UMARANE
accounts app name models.py class AddressUser(models.Model): customer = models.OneToOneField(Customer_create, related_name='customer_address', on_delete=models.CASCADE, blank = True,null=True) user = models.OneToOneField(User, on_delete=models.CASCADE, blank = True,null=True) ho

Re: Composable permissions question

2019-02-22 Thread Xavier Ordoquy
Hi, We might do that but handling None a is side effect that is not supported. Documentation (https://www.django-rest-framework.org/api-guide/permissions/#custom-permissions) says: The methods should return True if the request should be granted access, and False otherwise. Regards, Xavier Or

403 after get_queryset

2019-02-22 Thread Stijn De Weirdt
hi all, i'm facing an odd issue with a single api url: the request is re-authenticated somehow after the get_queryset is called (it's authenticated before the get_queryset, as is normal) the class is inherited from generics.ListAPIView, only overrides permission_classes, serialiser_class and ge