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
3
votes
3 answers

Django Rest Framework custom permission not working

I want users to have access only to the records that belong to them, not to any other users' records so I've created the following view: class AddressViewSet(viewsets.ModelViewSet): authentication_classes = (TokenAuthentication,) …
3
votes
2 answers

Group and Permissions Assignment Missing when using Custom User Model

I am building an app with multiple roles defined through Django Groups. I started with a custom user model, defined as below. I am seeing a weird difference in the groups and permissions use when using a custom user model, like the inheritance is…
3
votes
1 answer

Object level authorization in a Django Rest Framework viewset

I'm creating an API with Django Rest Framework (DRF) and wondering where I should handle object level authorization. So far I've created an Organization model and a custom user model with email being the unique identifier instead of username.…
3
votes
3 answers

Django Permission Required

I'm trying to check permissions for some API requests. I've already set auth users and auth_user_user_permissions and auth_permissions tables like view_company add_company bla bla, but the problem is not that. The problem is when I'm trying yo use…
3
votes
1 answer

How can I structure Django permissions to have multiple categories of permissions groups?

I'd like to have multiples layers of permissions for an API using Django Rest Framework, how can I best achieve this? Specifically the three categories of authorization I have are: Roles: Model level access, such as admin and different customer…
User
  • 339
  • 5
  • 16
3
votes
1 answer

Using both Groups and Individual Permissions

In Django I have created a system with various groups of users. Using django.auth I have also created permission groups and I have associated the appropriate application permissions for each group. This works great for role based access, but now I…
ViaTech
  • 2,143
  • 1
  • 16
  • 51
3
votes
5 answers

Django Rest Framework Custom Permission's Message Not Shown

I'm writing an application with the Django Rest Framework. I created a custom permission. I provided a message attribute to the custom permission, but still the default detail gets returned. Let me give you my code. permissions.py: from…
3
votes
1 answer

Row based permissions in Django

I have a simple Django model which looks roughly like this: from django.contrib.auth.models import Group from mylogapp.models import LogType class Log(models.Model): responsible_group = models.ForeignKey(Group) description =…
guettli
  • 25,042
  • 81
  • 346
  • 663
3
votes
1 answer

Restrict access to a part of a template to users that is part of a group using Class based views. Django 2.0

I want to restrict users in certain groups from accessing parts of the HTML template. I have a class based view that looks like this: Views.py class PostListView(ListView): model = BlogPost paginate_by = 10 template_name =…
ccsv
  • 8,188
  • 12
  • 53
  • 97
3
votes
3 answers

Django app for user/account settings

Im prepping for developing one project and am in process of mapping out stuff i can use for it. This project is going to need different group/user based model & object permissions and settings. I know i can use django-objectpermissions…
Odif Yltsaeb
  • 5,575
  • 12
  • 49
  • 80
3
votes
1 answer

django admin permissions to modify model's attributes

we are using django to develop a customer-management application, and we need to set permissions to an agent whether he/she can edit the customer's attributes (). for example, if i have a model: class Customer(models.Model): # basic information …
Maxim Mai
  • 145
  • 5
  • 14
3
votes
3 answers

How to dynamically name permissions in a Django abstract model class?

I want to define some custom permissions on an abstract model class that would then be inherited by all child classes, and rather than give the permissions a generic object name that could apply to any subclassed model type, I would like to…
gravelpot
  • 1,677
  • 1
  • 14
  • 20
3
votes
2 answers

Django sites framework permissions

I am using the sites framework to run multiple apps off of one code base. I have 3 users, and 3 sites. They can login to the django admin interface and create content but I want them to see only the site they are allowed to manage, not the others,…
3
votes
4 answers

User permissions for Django module

I'm having a small issue with my permissions in my Django template. I'm trying to, based on permissions, show an icon in the menu bar for my project. I want to have it so that if the user has the permissions to add a new follow-up to the project,…
3
votes
2 answers

Is there a Django app that can handle groups and permissions?

I know that Django has a permission/group system. But that's mostly tied to each model. (Correct me if I'm wrong.) My purpose is to have groups that can do multiple stuff. For example, one group can write to this and that. One group can edit this…
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080