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

Restrict model entries to author

I have model where users add organizations, how can restrict their access to only organizations created by the user? (restriction include view and edit). Example: User1 add Organization1 User2 add Organization2 User1 must see and edit only…
Ahmad Alzoughbi
  • 474
  • 1
  • 5
  • 14
0
votes
1 answer

Why I can't get the related objects of my pulgin?

I have some model # models.py class Email(models.Model): email = models.EmailField(blank=False, null=False) contact_block = models.ForeignKey('contact.ContactBlockPlugin', related_name='emails', blank=False, null=False) class…
Dmitry
  • 551
  • 6
  • 19
0
votes
1 answer

template tag and permissions not working

I cannot get permissions to work in django templates that are loaded via the use of the inclusion_tag. {% if perms.myapp.foo %}

In lookup works, too.

{% endif %} The above works fine in my "main" template that is called from my…
James
  • 815
  • 1
  • 13
  • 24
0
votes
1 answer

@permission-required argument in django

In a Django project I want to limit viewing of some views to admin (the user for which request.user.is_superuser is True) I know that I must use @permission_required(...) before that view, but what is the argument for this?
Branky
  • 373
  • 8
  • 23
0
votes
1 answer

Django permissions: Access to only one view method among many

Hi I have a project with many methods in view. Each method mapped to different urls. views.py def method1(request): print 'hello world' def method2(request): print 'hello world2' def method3(request): print 'hello world3' What i want…
wrufesh
  • 1,379
  • 3
  • 18
  • 36
0
votes
1 answer

Django-Braces - PermissionRequiredMixin redirecting to Login despite Permission being available

I am using django-braces MixIns. I have set-up permissions for my user groups. and i have this Class Based View : class ReportList(views.LoginRequiredMixin, views.PermissionRequiredMixin, ListView): permission_required =…
Ethan
  • 261
  • 5
  • 16
0
votes
0 answers

Only the creator should edit or remove a object, how?

I'm on a django app about academies, teachers and students. I want to set some permissions, and the first one is that only the user who create a object (academy, teacher or student) could edit or remove it. There's a object property that knows the…
rul3s
  • 332
  • 1
  • 2
  • 18
0
votes
1 answer

Permission for group of users that allows visit only one page

The issue that I have a group named Driver, and I want that users of that group to be able to visit only one special page with the url '/driver/' and no others. How do I implement such a thing?
Andrew
  • 423
  • 1
  • 6
  • 16
0
votes
2 answers

Is there Django view decorator to check a condition that doesn't assume the input is a User?

I have a very simple Django decorator my_decorator1 that looks like this: def my_decorator_1(function): @wraps(function) def decorator(self, *args, **kwargs): self.my_val = random.randint(0,1) return function(self, *args,…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
0
votes
1 answer

django permission to other owners

Imagine these models: User has many Buckets and each Bucket has many Items. User A only sees his own list of buckets and items in it. Now, I want to give user B permission to see user's A buckets but not items. Is this possible with Django built-in…
Sam R.
  • 16,027
  • 12
  • 69
  • 122
0
votes
1 answer

Return custom HTTP_STATUS_CODE while Django login

My Django REST API has this class for authentication: class AuthView(APIView): authentication_classes = (BasicAuthentication,) def post(self, request, *args, **kwargs): login(request, request.user) data =…
Saurabh Verma
  • 6,328
  • 12
  • 52
  • 84
0
votes
1 answer

Django. Permissions to model instance?

I have next models: class CategoryLesson(models.Model): title = models.CharField() class Lesson(models.Model): title = models.CharField() category = models.ForeignKey(CategoryLesson) class UserRole(models.Model): rolename =…
Raido
  • 63
  • 2
  • 6
0
votes
1 answer

How to do permissions right in Django

I have implmented a permissions system in django, but it is very basic and I think there might be better ways. From my understanding permissions are labels that attach to certain users, then it is up to me what actions I associate with them. For…
yayu
  • 7,758
  • 17
  • 54
  • 86
0
votes
1 answer

Django Issues with Multi Authentication in Tasty Pie SessionAuthentication Not Working

I'm trying to get 'Multi Authentication' to work in Tasty Pie. So far ApiKeyAuthentication() works making external calls, but when I use the API on my own Django site 'SessionAuthentication' (the same site the API is hosted on) it fails the…
GrantU
  • 6,325
  • 16
  • 59
  • 89
0
votes
1 answer

Django read only/view permission on models + row level permission

I am making a photo sharing application using Django Framework. I am stuck with 2 problems 1) The user who has uploaded photo can only edit that photo. Other users cannot edit that photo. But can see/view list of photos by all users. and also they…
Neil
  • 1,715
  • 6
  • 30
  • 45
1 2 3
28
29