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

A m2m Django permission model

Users on a webapp I'm building have multiple objects that are "theirs" Let's pretend the object is called Toy. I want them to be able to set privacy options for their Toys so they can set the following visibility options: Friends of…
Oli
  • 235,628
  • 64
  • 220
  • 299
1
vote
0 answers

Some models are not listed in user permissions

I am working with Django 1.8 and with its admin app. And when I try to set permissions for my "staff" users I can't see all my models. There are only some, and I don't understand because this should be done automatically, right? I am registering my…
jhrs21
  • 381
  • 1
  • 6
  • 21
1
vote
0 answers

django foreign key on meta permission

I have the following model in Django: class Foo(models.Model): name = models.TextField() permission = models.ForeignKey(Permission, null=True, blank=True) class Meta: permissions = ( ('permA', 'permA only for…
be-ndee
  • 1,153
  • 3
  • 13
  • 19
1
vote
1 answer

Django Admin Non Staff Access Data Filtering

I'm writing an application in Django (which I'm very new to) where the admin area will be exposed to 'customers' of the application, not just staff/superusers, because of the nature of the application and the way Django automatically generates forms…
1
vote
1 answer

Limited access to different roles in Django

I'm building a Django web application in which I have two roles e.g. sys_user and an exhibitor. When a sys_user logins in he has access to all the urls and app modules but an exhibitor will have limited access i.e he will have access to specific…
Sibtain
  • 1,436
  • 21
  • 39
1
vote
0 answers

Django : Team system

In my website, there are many teams. The team members have powers. These powers are depending on the member's role. On the website, some members can do actions specifics to role. Example: Member with the power to fly can create articles (class…
Zoulou
  • 303
  • 2
  • 16
1
vote
1 answer

What is best practice for restricting user permissions when editing model instances

I am building a simple app using User Authentication. My app has 3 models: Users : The standard Django user model Locations: A model for an office (address, site name, etc) Employees: A model for an employee (name, email, etc) I also have a…
alias51
  • 8,178
  • 22
  • 94
  • 166
1
vote
3 answers

Django - limiting url access to superusers

In my urlconf, i have: url(r'^sssssh/(.*)', staff_only_app.site.root), What I'd like to do is limiting any access to this application to superusers. I tried this: url(r'^sssssh/(.*)', user_passes_test(staff_only_app.site.root, lambda u:…
Agos
  • 18,542
  • 11
  • 56
  • 70
1
vote
1 answer

Django: How to manage groups and permission without using default admin

I am working on Django project as per requirements I need to manage users, groups and permissions in custom template. So I am not using default admin dashboard. I have completed user creation module, now I want to assign permissions and groups to a…
Shoaib Ijaz
  • 5,347
  • 12
  • 56
  • 84
1
vote
1 answer

@permission_classes((IsAuthenticatedOrReadOnly,)) allowing anonymous user to post data

I have added @permission_classes((IsAuthenticatedOrReadOnly,)) annotation on my view n on calling post without auth details it is allowing to post data? @permission_classes((IsAuthenticatedOrReadOnly,)) @api_view(['GET','POST']) def…
drs
  • 23
  • 3
1
vote
0 answers

Permissions for specific object instance to another in Django

after I went through the Documentation and other people's questions in the same topic. still, I couldn't find the solution!! I need each instance of User object to have a permission to Edit another specific instance object(I created the Model). once…
john
  • 25
  • 6
1
vote
1 answer

Django admin creating inline model object

Inside my django admin, I am creating an admin model that has a one to many relationship with another table. Let us call it Recipes and Ingredients. Each recipe has multiple ingredients. I want to make it so in the admin page a user can create a…
1
vote
1 answer

Django - Create "hard-coded" groups and permissions

I need to define some permissions and groups that are used in the models and the views. I know how to do it with permissions (define them in the "Meta" of some models), but it is not clear to me how to do it with groups. Maybe the right thing to do…
Giove
  • 354
  • 1
  • 3
  • 10
1
vote
1 answer

Adding django_content_type and permission without model

I want to have some permissions on few contents, which are NOT models, but are 'name' in the following table: mysql> select * from my_contents; +----+---------------------+ | id | name | +----+---------------------+ | 1 | content1 …
Saurabh Verma
  • 6,328
  • 12
  • 52
  • 84
1
vote
1 answer

Django user not getting the assigned group's permissions

I am using django admin back end for creating user groups. I created a group called admin and assigned several permissions to it. But when I assign this group admin to a user the permissions of that group are not automatically assigned to the…
zaphod100.10
  • 3,331
  • 24
  • 38