Questions tagged [django-permissions]

django-permissions is a pluggable django app that provides per-object permissions for Django based on roles

django-permissions is a pluggable django app that provides per-object permissions for Django based on roles.

431 questions
0
votes
1 answer

Django viewflow extend task view

Am trying out an idea to use both django-viewflow and django-permission in an app where there would be some complicated permission rules. The way that I have understood the way django-permission works is by adding a decorator to the view that you…
dj.bettega
  • 117
  • 1
  • 1
  • 11
0
votes
1 answer

where does the defenition of custom permission exist?

In the docs, it says that the below given way can be used to give custom permissions.The has_perm decorator is used to check user permissions. But it does not say where these permissions are defined or what they do. Do i not need to define them ? If…
SayYes
  • 1
  • 3
0
votes
1 answer

django rest framework JWT returning anonymous user despite permission class angular 5

I am using angular 5 on the front end. With an HTTP Interceptor which if the client is logged in, sends a token along with any http request made to my server. I am able to log into my system. So the JWT scheme is working correctly. The interceptor…
0
votes
1 answer

django-permission AuthorPermissionLogic not working in function based view

Am using django-permission on simple test app (almost identical to the example used in the docs) to try to figure out how it works. I have read the documentation and tried to use the example app provided on this link. The issue is when the author of…
dj.bettega
  • 117
  • 1
  • 1
  • 11
0
votes
1 answer

Can I get cookies value or session value inside the has_permission method of django rest framework?

I am working on a project where i have to check the user whether they belong the company or not.i am already put check while login user. how i can use company id inside the has_permission() method? class…
0
votes
1 answer

django mixin to make sure that user is active

I need to make sure that authenticated user is active for access the page. Is there any mixin for that in django? If not then how to do so. Thanks in advance.
Pankaj Sharma
  • 2,185
  • 2
  • 24
  • 50
0
votes
2 answers

Check user permission in template (not request user)

Hello is there any way to check perms of custom user nit request user in template. Code example: {% for agency_user in users %} {{ agency_user.username }} {{ agency_user.get_full_name }} {{…
Beliaf
  • 577
  • 2
  • 8
  • 25
0
votes
2 answers

Check if user has a permission with specific codename in django

I am trying to check if a user has a permission, which I have defined in the class Meta of the model, with a specific codename. At the moment I have: if request.user.has_perm('app_label.code_name'): do something What I am trying to avoid is…
dsax7
  • 1,333
  • 22
  • 36
0
votes
1 answer

Django upload model - user permissions

I am creating a file upload page which has a file upload model: models.py class Upload(models.Model): file = models.FileField(blank=True, null=True, validators=[validate_file_extension]) upload_date = models.DateTimeField(auto_now_add=True) …
0
votes
2 answers

How set permission for specific app in Django Rest Framework

I have two REST application in my Django project: api - should be AllowAny and ReadOnly! apicrm - should be rest_framework.permissions.IsAuthenticated How to set this permission for whole app in Django Rest Framework?
0
votes
2 answers

Object-level Permissions

I am sure that this is fairly straightforward, but I have scoured the documentation and I can't quite figure out how to do this. I have extended my User class to have two ManyToMany relationships to other users: trainers and teammates. If a user…
0
votes
2 answers

Do not show salaries in the table - Django permissions

I've had a table in which different expenses are displaying which are bills, rents, salaries, etc, and I want to hide salaries from my staff, so I'm adding new filter to my queryset which needs to restrict that to them, but when I test it with…
copser
  • 2,523
  • 5
  • 38
  • 73
0
votes
1 answer

Secure URL/page for AnonUser to update a model field - Django Rest framework

I have a model called Lead which represents my possible future_customer. In order to update a boolean field called is_approved in this model, I'm sending an email to the Lead's email ID along with a URL and this URL will take you to a page in my…
0
votes
1 answer

Functional permissions in Django

Is there a built in way to assign functional permissions to users in Django? From documentations looks like Dajngo permissions are bound to Models. For example, what I want is to create is 4 types of user groups: Normal users, Managers, Admins and…
Harshveer Singh
  • 4,037
  • 7
  • 37
  • 45
0
votes
1 answer

Authentication Backends file

I wish to customize my authentication backends, i'm a beginner in django and i want to practice, but i am alittle confused. I red the documentation but for their example and for each example i found, no one says where you should write the class. Do…
alex
  • 2,381
  • 4
  • 23
  • 49