All Questions
Tagged with permissions django
585
questions
0
votes
0
answers
16
views
django permission using UserPassesTestMixin
I tried to use the user.has_perm() method, but it always returns False.
def test_func(self):
# Define your custom access control logic here
user = self.request.user
return user....
0
votes
1
answer
32
views
My user has permissions but does not have access to pages in django app
My user has for example the following permissions: add_client, view_client, delete_client, change_client of the Client model
print(user.request.user_permissions.all()) gives <Permission: elec_meter ...
0
votes
0
answers
38
views
Django custom group permission return 401 code as Unauthorized user
I want create user permission based on user group membership.
But next code return next error message "Request failed with status code 401".
And for authorized user print(request.user) ...
0
votes
1
answer
39
views
Django rest framework is providing the wrong parameters to custom permission class
I'm having an issue where Django Rest Framework's custom permission system is treating my custom permissions' methods like they are classmethods or staticmethods.
When hitting a breakpoint in the ...
0
votes
0
answers
33
views
Got 403 error in accessing all files in media directory which have dynamic generated subdirectory users, and maindalali
I am using Django + react, all are deployed on the same EC2 server, IAM USING Daphne as ASGI server and nginx as reverse proxy... The problem is only on access and not on serving media like Images, ...
0
votes
1
answer
74
views
Question about using Group or Role in frontend application to restrict view
I am building an application that comprises a python backend using the django framework and a vue application on the frontend. I am using with success the authorization and permissions framework ...
0
votes
1
answer
52
views
Custom permissions in Django DRF class based view
I'm trying to set custom permissions in a ModelViewSet. I want to allow any authenticated user to list and retrieve items but only Admin and Manager can create, update, and destroy.
Here is the ...
0
votes
1
answer
45
views
has_object_permission method doesn't work Django REST Framework
I want to check in my ModelViewSet if user can create the invitation for the other user to his company. I have 4 models:
# Abstract model TimeStampedModel
class TimeStampedModel(models.Model):
...
0
votes
0
answers
24
views
How can I set group permissions that filter pages according to their owners in Wagtail
I am working on a blog with Wagtail and would like to give users access to create their own content in the Wagtail admin. I would like users to be able to log into the Wagtail admin, but only have ...
0
votes
0
answers
34
views
Problem in a customized permission in Django rest framework
I tried to make a customized permission class which ensures that the user is authenticated and the authenticated user trying to access the endpoint is accessing information related to him not another ...
0
votes
1
answer
278
views
(Linux-Ubunto Permission problem) Nginx can't load static/media files from Django Site
this is more of linux permission problem. Im trying to create a website with nginx and django, but I'm getting error 403 forbidden, so my nginx is not able to read my statics files, I'm not ...
0
votes
0
answers
119
views
Getting "Authentication credentials were not provided." error when making a request to another api endpoint with required auth, on behalf of a user
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
self.perform_create(serializer)
headers = ...
1
vote
1
answer
709
views
Custom user level throttling with Django rest framework
I am trying to set API call limits by tier group. Basically a free tier, a paid tier and another paid tier with more limits. I am using Django rest framework and the issue I keep running into is ...
2
votes
2
answers
97
views
Is there a difference between permission_classes = [A, B], permission_classes = [A & B]?
What is the difference between
permission_classes = [A, B]
permission_classes = [A & B]
??
I understand that the first one processes permission sequentially, and the second one does it at once.
...
0
votes
1
answer
80
views
Let Django access serial port in Lubuntu
So, I need my Django to access the serial port
I'm correctly using it via pyserial package the issue is that, every time I boot the OS I got the error of Access denied.
The only way to make it work is ...