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

How to disable/enable a button on input empty/full while keeping permissions

So I know how to disable/enable a button when inputs in the same form are empty/filled. But let's say I have applied backend permissions first and disabled some buttons. How do I make sure they are not re-enabled when someone with no permissions…
Seif
  • 1,058
  • 11
  • 19
0
votes
1 answer

django for permisosin ,add ,delete ,change

I have Post model and I want to allow a user to add, change and delete. global | post | User can add a post global | post | User can delete the post global | post | User can change post can someone help me ?? I try this in my views and its gives…
0
votes
1 answer

Best solution to functional permissions on django multi-site app

I have two sites running off the same base code. Each site has different requirements for which functions different user types can see. For example, one site says anyone can view the News page but on the other only logged in users with a value in…
PhoebeB
  • 8,434
  • 8
  • 57
  • 76
0
votes
2 answers

Django Custom Permission for Authorization

I am working on a Django Project, where one model (lets say Document) has the following field: #In models.py class Document (models.Model): choice = (('Yes','Yes'), ('No','No')) authorized = models.CharField (max_length=3, choices=choice,…
Sayantan
  • 315
  • 5
  • 20
0
votes
1 answer

Django user permission inside template

I created a custom auth permission in django via admin site, and i added that permission to a user (not a group), now i want to ask if the request user in a template has it but nothing works.It's not a duplicate, i already checked similar questions…
jsanchezs
  • 1,992
  • 3
  • 25
  • 51
0
votes
0 answers

ProgrammingError at /api/contacts/

I get the following error in my app: I've have this model: from django.db import models from apps.account.models import Account from .category import Category class Contact(models.Model): name = models.CharField(max_length=60) …
0
votes
0 answers

Django permissions to view

I want to restrict access to certain views based on the current User's email address. Are Permissions the way to go here? My thought is "no" because, as far as I understand, permissions are for model objects.
ukejoe
  • 737
  • 2
  • 9
  • 20
0
votes
1 answer

Django Permissions App

I've the following models. class Ads(models.Model): title = models.CharField(max_length=255) description = models.TextField(blank=True, null=True) start_price = models.IntegerField(db_index=True, blank=True, null=True) seller =…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
0
votes
1 answer

Confusion with the Django permission system

Django comes with a simple permissions system. It provides a way to assign permissions to specific users and groups of users. Like this: 'app_lable.model_name'. It may be convenient for the django admin, but I think it will be use difficult when I…
Helpme123
  • 97
  • 1
  • 9
0
votes
1 answer

Django Permissions: How to make extended User only to update and view profile?

I'm trying to write custom permissions for the extended user which I created so that it should only be allowed to see(retrieve) the user profile and update it. However with my current code, it is not allowing User to see it's profile. I've just…
0
votes
1 answer

Django-rest: How to implement authentication and permissions for custom User models?

views.py class UserList(generics.ListCreateAPIView): queryset = User.objects.all() model = User serializer_class = UserSerializer paginate_by = 10 def get_queryset(self): queryset = User.objects.all() …
0
votes
1 answer

How do you set Django permissions based on models linked to a user (and not based on a user's group)?

I have to make a system which will allow users to progressively fill out surveys based on whether or not the initial survey was accepted. What this means is that after the user has logged in, they need to be able to fill in a preliminary survey for…
SimoneC
  • 5
  • 1
  • 6
0
votes
1 answer

DjangoRestFramework - object level permission not being allowed for some reason (has_permission and has_object_permission)

This is my permission: class IsFllowOrAdminUserOrReadOnly(permissions.BasePermission): """ Allow any users to follow objects and ReadOnly. Allow all requests for admin users. """ def has_permission(self, request, view): …
SilentDev
  • 20,997
  • 28
  • 111
  • 214
0
votes
1 answer

DjangoRestFramework - How to properly seperate has_permission and has_object_permission

Here is my permission class: class IsCreationOrFollowOrOwnerOrReadOnly(permissions.BasePermission): """ Allow any users to create, get and follow objects. Allow only owners to PUT, PATCH and DELETE. """ def has_permission(self,…
SilentDev
  • 20,997
  • 28
  • 111
  • 214
0
votes
1 answer

URL blocking in django admin site to staff users

I have an app 'app_name' which has a profile object which is linked to User object via OneToOne field way. Now on login I redirect the user to a edit profile page on admin site using url using his profile object id. I've granted as expected is_staff…
CharcoalG
  • 185
  • 4
  • 12