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
1 answer

django-permission allow all @decorator

An app I have been hired to work on is using django-permission. Every view in the application requires authentication, but I need to create a simple way so I can have endpoints that doesn't require authentication. One usecase is for /callbacks. I…
webjay
  • 5,358
  • 9
  • 45
  • 62
1
vote
0 answers

How to set permissions for an inherited User model from AbstractBaseUser with Django restframework

lets have a structure of my User model. BaseUser <- BusinessOwner <- Business Staff (BusinessOwner can create,update,delete BusinessStaff ) BaseUser <- Customer I'm having problem when creating an inherited user from AbstractBaseUser, All i want is…
1
vote
0 answers

Denying user permission in Django

I have a short question - is there a way to DENY already given permission ? I have a 2 cases where i'll want to use that feature: 1, i have a user that is in particular group, which has some regular permissions, but i want to (temporary) remove some…
alienn
  • 223
  • 2
  • 10
1
vote
0 answers

READ ONLY MODE DJANGO ADMIN

Django Version 1.3 + python2.7 I am working with permissions these days and i find it extremely useful. I want to go in more detail so i have two questions :- 1) How can i implement a read only mode for a model in django admin(including inlines ,…
djangobot
  • 257
  • 1
  • 2
  • 11
1
vote
1 answer

How to get Permissions to inherit from User's Groups?

I'm trying to figure out Django Groups and the documentation is pretty bare on the site. For example, you can use the decorator permission_required() to check the permissions, however, this only checks if you have assigned permissions directly. I…
Matt McCormick
  • 13,041
  • 22
  • 75
  • 83
1
vote
1 answer

list permissions list of apps in Django front end

I want to list the permissions created by django for a model for specific app like it is done in django backend while creating users: app_name | model_name | can add model_name How to do this?
pynovice
  • 7,424
  • 25
  • 69
  • 109
1
vote
1 answer

Django add custom permission in model

I have order model, and i want add custom permission using class META class Order(models.Model): STATUS_CHOICES = ( ('0', 'Готов'), ('1', 'Ждет оплаты'), ('2', 'Подтвержден'), ('3', 'В работе'), ('4',…
lmasikl
  • 193
  • 2
  • 16
1
vote
1 answer

django admin inline delete without permission

Well, I have a django admin project. There are two models in that site which are named Book and Author. And the Author is the foreign key of Book. In the Admin class of Author, I add Book as inline form. For the regular user, I remove the delete…
Jerry Meng
  • 1,466
  • 3
  • 21
  • 40
1
vote
0 answers

Django built in User table alter

I want to alter the built-in User table that comes with django activating admin mode.I heard somewhere that it cannot be altered. And someone suggested to not use the user-table.So if I create a user model on my own , How do I set…
1
vote
1 answer

Django Foreign Key to Permission

class Application(models.Model): name = models.CharField(max_length=100) icon_url = models.CharField(max_length=100) app_url = models.CharField(max_length=200) I would like to add another field for required_permission which should be a…
Jacob Valenta
  • 6,659
  • 8
  • 31
  • 42
1
vote
2 answers

Add users to a group by emails through a view (allow comma separation for mulitple)

I would like to be able to add users in Django to a user-created group through a view and a template form. Creating the groups is easy, I just am having trouble creating a way to add bulk users (like this email1@email.com, email2@email.com,…
0
votes
0 answers

Assigning model1 permissions to a model2 instance in Django using Django Guardians

I am using Django Guardians in my project and it works fine so far, but there is some problem: I need to assign permissions from model1 to the instance of the model2. Real example: The shop has some contracts and the shop owner wants to assign his…
0
votes
1 answer

Permission denied for ....// CRUD ModelViewSet endpoints

I am trying to create a ModelViewSet for supporting CRUD operations on my address model. I am able to successfully use LIST and CREATE endpoints, but all the other 4 endpoints which require/id/ in their URL return me the error - { "detail": "You do…
0
votes
1 answer

How to update widget attribute based on user role in Django

I have this custom widget: class RelatedFieldWidgetCanAdd(widgets.Select): def __init__(self, related_model, related_url=None, can_add_related=True, *args, **kw): self.can_add_related = can_add_related …
Ankit Tiwari
  • 4,438
  • 4
  • 14
  • 41
0
votes
0 answers

Django - How to write a custom permission mixin?

There's a view that gets a parameter. class MyView(View): def get(self, request, pk): # ... ^^ To decide whether the user is allowed or not, that parameter is needed. Is it possible to write a custom permission mixin to…
ParsaAi
  • 293
  • 1
  • 14