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
1
vote
3 answers

How to add permissions to edit own in django admin based on value in model?

I have a question about Django-Admin. Every item in my Django admin has got the "EngagementManager" field, which contains the name of the person. When you log in Django, your username is the same as the field, which I mentioned previously. I need…
webmourek
  • 59
  • 8
1
vote
1 answer

How can I restrict access to a view to only super users in Django

On a site I am developing in Django, I want to restrict access to views so only superusers can access them. I could use @login_required or the LoginRequiredMixin, however I already have a login system for the average person, so that would let any…
jeremy_lord
  • 469
  • 7
  • 23
1
vote
1 answer

How to let user fetch only those objects they are related to (by many-to-many relationship)?

I have a project in which there are workspaces, and each workspace can have any number of users. Users can also belong to multiple workspaces, so there's a many-to-many relationship between them. Now, I have workspace creation and membership…
manabreak
  • 5,415
  • 7
  • 39
  • 96
1
vote
1 answer

Anyone is able to delete or update other's post through url

Hy, I am developing a Django Blog application. In this application, I have a PostEdit view to edit the post, Delete post view to delete the post. These operations can only be performed by the user who has created that post. I used Delete view as a…
1
vote
1 answer

Django group permissions for specific model

I'm working on a website for my neighbor, and I was almost completely done. But he added one more feature that I can't seem to wrap my head around building. The feature in itself is pretty simple, and I already have it written. He just wanted a…
Justin Boucher
  • 343
  • 4
  • 17
1
vote
1 answer

Django DRF role level permission

I have developed API's using DRF. I am struggling to relate the authorization part from Django's default permission which we define in the admin section for each and every role to the API. Let's say I have two API's Customer Management and Customer…
1
vote
1 answer

Formatting a permissions QuerySet so that it just displays the name column

I am trying to list the permissions specific to a model through a query. The goal is to just display the "name" part of the QuerySet. I'm only able to get the output below through the tag: {{ permissions }}
DanielK
  • 257
  • 2
  • 15
1
vote
1 answer

Implementing multi layer role on Django

Working with django Group and Permission. Normally works fine. Now want to add sub admin who can give permission only particular model. How to implement?
Russell
  • 1,624
  • 5
  • 23
  • 43
1
vote
1 answer

Where in the project code are groups instances created and permissions assigned?

I was going through the documentation of django 2.1, I see that group permissions can be created inside a user model, or directly and then they can be assigned to a group instance using the permissions attribute. What I don't get is where in my…
Shashwat
  • 439
  • 7
  • 13
1
vote
0 answers

Permission linking between LDAP users groups and Django permissions (custom if possible)

Hello again every one, I have a question: I successfully implemented django-auth-ldap, the LDAP users can request successfully my DRF API. But nows, for my projetc needs, I have to define permissions depending of the group. Indeed, I will have like…
1
vote
2 answers

DRF Object level permissions check for single field

How do you add permissions to a model so that any user can add a new instance, but only a logged in user can add a particular attribute? Django models.py: class Ingredient(models.Model): name = models.CharField(max_length=100, unique=True) …
chris Frisina
  • 19,086
  • 22
  • 87
  • 167
1
vote
1 answer

Group permission connected to model list

My model: class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) POSITIONS = ( ("volunteer", "volunteer"), ("employee", "employee"), ("manager", "manager"), ("director", "director"), ("vet",…
J.Cleese
  • 25
  • 1
  • 6
1
vote
2 answers

Restrict User from view based on existing model

I have a few really simple views in my views.py. class IndexView(generic.ListView): template_name = 'voting/index.html' context_object_name = 'latest_question_list' def get_queryset(self): """ Return the last five…
kstr
  • 119
  • 9
1
vote
1 answer

Django : how to give user/group permission to view model instances for a specified period of time

I am fairly new to Django and could not figure out by reading the docs or by looking at existing questions. I looked into Django permissions and authentication but could not find a solution. Let's say I have a Detail View listing all instances of a…
1
vote
1 answer

Is OAuth2 TokenScope similar to Django Permissions?

I'm building a dedicated OAuth2 as a service for my application, where users will be both authenticating and authorizing themselves. I've the following concerns 1) Is OAuth2 TokenScope similar to Django Permissions? 2) If I want to make role-level…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267