Duplicate Permissions Created on Model Rename

2023-08-03 Thread Dipak Pawar
*Description*: After renaming the model from "Group" to "CollegeGroup" in my Django project, duplicate permissions are being created for the renamed model. This results in two sets of permissions with the same functionality, one set with codenames like "add_group"

Re: Roles and Permissions in python Django

2023-04-02 Thread Muhammed Lawal
d > permissions.This is what i am supposed to do. > > I am supposed to do the roles and permissions. > So I have done the roles but now permissions is the problem. > For example the organisation admin and the local admin when logged into > the system they are supposed to see the dashb

Re:Roles and Permissions in python Django

2023-04-01 Thread Daisi Caroline
Hello friends i am doing a django project and i am stack on roles and permissions.This is what i am supposed to do. I am supposed to do the roles and permissions. So I have done the roles but now permissions is the problem. For example the organisation admin and the local admin when logged into

Re: Permissions front end management in Django

2022-05-04 Thread Ry
; > On Jan 4, 2022, at 2:59 PM, Eugene TUYIZERE wrote: > > Derar Team, > > I have a django application and I want the admin to manage the permissions > for different functions. This should be done in way way like below: > > > > by editing you can allow the user a

Re: Permissions front end management in Django

2022-01-08 Thread oneanplusgold
Control alt delete to all coding problem! > On Jan 4, 2022, at 2:59 PM, Eugene TUYIZERE wrote: > > Derar Team, > > I have a django application and I want the admin to manage the permissions > for different functions. This should be done in way way like below: > >

Re: Permissions front end management in Django

2022-01-04 Thread Muhammad Juwaini Abdul Rahman
You can handle using conditions in template. Or search for library for role based permission. On Tue, 4 Jan 2022 at 19:00, Eugene TUYIZERE wrote: > Derar Team, > > I have a django application and I want the admin to manage the permissions > for different functions. This should be

Permissions front end management in Django

2022-01-04 Thread Eugene TUYIZERE
Derar Team, I have a django application and I want the admin to manage the permissions for different functions. This should be done in way way like below: [image: image.png] by editing you can allow the user access,view, create, modify or delete the particular view. How can I achieve this in

Re: Using ModelForm in inlineAdmin with view permissions

2022-01-03 Thread the.one.abo...@gmail.com
Hi, My previous email did not include link to the demo project. Please find the demo project here: https://github.com/pandafy/inline_view_only. Thanks, Gagan Deep On Saturday, January 1, 2022 at 10:15:21 PM UTC+5:30 the.one.abo...@gmail.com wrote: > Hello everyone! > > I have created a de

Using ModelForm in inlineAdmin with view permissions

2022-01-01 Thread the.one.abo...@gmail.com
Hello everyone! I have created a demo project to convey my use case programmatically. Here is a brief description of the project. The Django project contains an application "home" that has four models: Device, Location, FloorPlan and DeviceLocation. DeviceLocation is a thorough model that con

RE: Permissions Model Inefficiency Killing DB

2021-11-26 Thread gpjhostavie bouala
Please can someone help me to install Django ? On windows i'm having trouble with the installation. Le 24 nov. 2021 23:34, "Mike Dewhirst" a écrit : > Do you think this is a consequence of permission complexity? > > I have instinctively avoided individual permissio

RE: Permissions Model Inefficiency Killing DB

2021-11-24 Thread Mike Dewhirst
Do you think this is a consequence of permission complexity?I have instinctively avoided individual permissions for purely management reasons and stuck to user membership of auth groups (roles) and given permissions exclusively to groups.That postpones lookups to when they are needed.I can&#

Permissions Model Inefficiency Killing DB

2021-11-24 Thread Ryan Skadberg
Hi All - Running Django 2.2.24 (Yes, I know, we are working on moving to 3.2) I've noticed some stalls in startup and finally have tracked it down. It appears when permissions are imported, it checks EVERY user for permissions, NOT just the ones in the user_user_permissions table.

Re: permissions mapping

2021-09-07 Thread Lalit Suthar
https://docs.djangoproject.com/en/3.2/topics/auth/default/#permissions-and-authorization On Tue, 7 Sept 2021 at 18:42, Ssentumbwe Enoch wrote: > I want to design a factory management application but I need some guidance > roles permissions. > I want to divide the floor into sections

Re: permissions mapping

2021-09-07 Thread MUGOYA DIHFAHSIH
Hello Enoch. Have you considered using permissions on this, i think it is the best way to implement this functionality. You implement this on the views by checking if the user is authorized to access the view in this case the edit function. On Tue, 7 Sept 2021 at 16:12, Ssentumbwe Enoch wrote

permissions mapping

2021-09-07 Thread Ssentumbwe Enoch
I want to design a factory management application but I need some guidance roles permissions. I want to divide the floor into sections whereby a supervisor in section A can review and edit section A's functions without having rights to edit section B's functions. He or she can view

Re: roles and permissions

2021-08-15 Thread Abeer Eltanawy
Sorry, this is the link: https://testdriven.io/blog/drf-permissions/#drf-permissions On Sun, Aug 15, 2021 at 6:26 AM Lalit Suthar wrote: > https://www.django-rest-framework.org/api-guide/permissions/ > > On Sat, 14 Aug 2021 at 04:35, Mike Dewhirst wrote: > >> Have you looked

Re: roles and permissions

2021-08-14 Thread Lalit Suthar
https://www.django-rest-framework.org/api-guide/permissions/ On Sat, 14 Aug 2021 at 04:35, Mike Dewhirst wrote: > Have you looked at ... > > https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html > > > > > --

RE: roles and permissions

2021-08-13 Thread Mike Dewhirst
permissions I want develop Custom Roles And Permission Any one guide me  -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@google

Re: roles and permissions

2021-08-13 Thread Abeer Eltanawy
I find this article (and the succeeding 2 articles in the post thread) is a great resource for how to manage roles and permissions with DRF. On Fri, Aug 13, 2021 at 3:28 PM Amit Vaghani wrote: > I want develop Custom Roles And Permission > Any one guide me > > -- > You receiv

roles and permissions

2021-08-13 Thread Amit Vaghani
I want develop Custom Roles And Permission Any one guide me -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view

Admin Site Permissions issue with one particular model

2021-06-23 Thread Jimmy Gawain
trimmed a lot of stuff but that is because it is exactly the same between the two models. What could be causing this one model admin to have a permissions issue? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Make permissions according branch id

2021-06-13 Thread Nikeet NA
; Did any one understands what I mean > ? > في السبت، 12 يونيو 2021 في تمام الساعة 3:43:09 م UTC+3، كتب ‪wael > muhammed‬‏ رسالة نصها: > >> >> I want to make permissions according branch id >> for more details >> <https://stackoverflow.com/questions/67

Re: Make permissions according branch id

2021-06-12 Thread wael muhammed
Did any one understands what I mean ? في السبت، 12 يونيو 2021 في تمام الساعة 3:43:09 م UTC+3، كتب ‪wael muhammed‬‏ رسالة نصها: > > I want to make permissions according branch id > for more details > <https://stackoverflow.com/questions/67946118/django-permissions-accordi

Make permissions according branch id

2021-06-12 Thread wael muhammed
I want to make permissions according branch id for more details <https://stackoverflow.com/questions/67946118/django-permissions-according-to-branch-id> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from thi

Feature request for django permissions

2021-06-12 Thread wael muhammed
I have a projects with multi branches . I want to make permissions according to branch record. I couldn't add customize django permissions model to make foreign key from branch model. Look here <https://stackoverflow.com/questions/67946118/django-permissions-according-to-branch-id>

Re: Question about permissions for django.git

2020-10-31 Thread Christopher Keith
Hey Kasper- Many thanks! Tried your suggestion and it works. Does this mean that my specific git configuration is such that the 'git' URL will not work? If so, it is possible that https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/ could be updated to s

Re: Question about permissions for django.git

2020-10-31 Thread Kasper Laudrup
Hi Chris, On 31/10/2020 17.02, Christopher Keith wrote: Folks - I am following the instructions from https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/working-with-git/ . However, when I try to 'git fetch' the source repo, I get 'Permission denied' PS C:\Users\chr

Question about permissions for django.git

2020-10-31 Thread Christopher Keith
pstream g...@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. I have tried this on Linux Mint also, and get the same error. Do I need to be added to some permissions list? Thanks

Limiting access to data through user permissions?

2020-07-10 Thread Will Meyers
.CharField(max_length=255) class License(models.Model): name = models.CharField(max_length=255) permissions = models.ManyToManyField(CustomPermissions) ... class User(AbstractBaseUser): license = models.ForeignKey(License, on_delete=models.CASCADE) ... This works fine i

How to implement differenciated permissions for basic and advanced admin sites ?

2020-06-19 Thread Olivier
Hello, I'm implementing one basic and one advanced Django 3.0 admin site. How can I enforce differenciated permissions for them ? I thought about: 1. Dedicating advanced admin site to Superuser, leaving basic admin site to Superuser or Staff members 2. Leaving advanced admin site to Supe

Custom Permissions of Django Materialized View

2020-06-10 Thread Will Meyers
Hi all, I'm building an application that uses Django Rest Framework and Django Guardian. I have to implement a permissions system such that when a user requests data from a materialized view, I need to omit certain rows from the returned queryset based on the user's group. For exam

Re: Multiple user roles with permissions

2019-09-26 Thread Shazia Nusrat
So kind of you George. It worked for me in examples and thanks for adding Python code example search engine. You really made my life easier. :-) Regards, Shazia On Thu, Sep 26, 2019 at 4:39 AM George Tantiras wrote: > Repositories using django-rules: > > > https://github.com/dfunckt/django-rul

Re: Multiple user roles with permissions

2019-09-26 Thread George Tantiras
Repositories using django-rules: https://github.com/dfunckt/django-rules/network/dependents?dependent_type=REPOSITORY Packages using django-rules: https://github.com/dfunckt/django-rules/network/dependents?dependent_type=PACKAGE Search engine for python code examples: https://www.programcreek.com/p

Re: Multiple user roles with permissions

2019-09-25 Thread Shazia Nusrat
I just needed a working example of added permissions system in a project I can run. Django-rules is good and I've tried it in my test-project. I was hoping a project with bunch of user types and assigned permissions hardcoded. I know I can do things from default admin dashboard. Regards, S

Re: Multiple user roles with permissions

2019-09-25 Thread George Tantiras
I would recommend django-rules: https://github.com/dfunckt/django-rules -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.

Re: Multiple user roles with permissions

2019-09-25 Thread Aldian Fazrihady
What do you need to clarify regarding this document https://docs.djangoproject.com/en/2.2/topics/auth/default/#the-permission-required-decorator ? On Wed, Sep 25, 2019 at 9:03 PM Shazia Nusrat wrote: > Hi, > > I need help to understand implementation of multiple user roles and > pe

Re: Multiple user roles with permissions

2019-09-25 Thread Shakil Ahmmed
On Wed, Sep 25, 2019 at 8:03 PM Shazia Nusrat wrote: > Hi, > > I need help to understand implementation of multiple user roles and > permissions on views/templates/objects. If someone can point me to really > nice project at GitHub I will be really thankful. I couldn'

Multiple user roles with permissions

2019-09-25 Thread Shazia Nusrat
Hi, I need help to understand implementation of multiple user roles and permissions on views/templates/objects. If someone can point me to really nice project at GitHub I will be really thankful. I couldn't find one so far. Regards, Shazia -- You received this message because yo

Re: need permissions for post method

2019-09-10 Thread Micheal Desousa
dei Thanks, with regrads Micheal. On Tue, Sep 10, 2019 at 5:20 PM siva.gatti wrote: > Hi, > > class UserViewSet(viewsets.ModelViewSet): > permission_classes = [IsAuthenticated] > queryset = Documents.objects.all() > serializer_class = DocumentSerializer > > this is my viewset. I wan

need permissions for post method

2019-09-10 Thread siva.gatti
Hi, class UserViewSet(viewsets.ModelViewSet): permission_classes = [IsAuthenticated] queryset = Documents.objects.all() serializer_class = DocumentSerializer this is my viewset. I want to allow users for post method without authentication how can i add allowed methods here.with authe

DRF Permissions

2019-09-02 Thread Suraj Thapa FC
In DRF, only AllowAny permission is working. My Views.py class generate_course(APIView) : . . . permission_classes = (IsAuthenticated,) authentication_classes = (JSONWebTokenAuthentication,) def post ( self, request) : ..

Fwd: Django template permissions not working when used inside the template of an inclusion tag

2019-08-12 Thread er
-template-permissions-not-working-when-used-inside-the-template-of-an-incl I have 2 apps in a Django Project i am using to learn django. In the app A I have an inclusion tag where I am using a template named templateA.html. This inclusion tag is being used in the app B, inside the template templateB.html

Re: What's the best way to have app access permissions?

2019-07-16 Thread Jani Tiainen
We use django groups for that. So we give groupnames like ALLOW_SOMETHING and then in code and templates we do check if user has that group or not. ti 16. heinäk. 2019 klo 19.26 Tal kirjoitti: > I know you can have permissions on individual models that control which > users have access t

What's the best way to have app access permissions?

2019-07-16 Thread Tal
I know you can have permissions on individual models that control which users have access to them, but I need something for my apps. Ex. If a user logs in, does he have access to the store_app? The forum_app? etc. I have a solution that looks something like this: models.py: class MyUser

Re: How to use permissions on a CreateView class?

2019-05-31 Thread Fellipe Henrique
gt;>> >>>> from django.contrib.auth.decorators import login_requiredfrom >>>> django.utils.decorators import method_decoratorfrom django.views.generic >>>> import TemplateView >>>> class ProtectedView(TemplateView): >>>> template_

Re: How to use permissions on a CreateView class?

2019-05-30 Thread Andrew C.
from django.views.generic >>> import TemplateView >>> class ProtectedView(TemplateView): >>> template_name = 'secret.html' >>> >>> @method_decorator(login_required) >>> def dispatch(self, *args, **kwargs): >>>

Re: How to use permissions on a CreateView class?

2019-05-30 Thread Andrew C.
ric >> import TemplateView >> class ProtectedView(TemplateView): >> template_name = 'secret.html' >> >> @method_decorator(login_required) >> def dispatch(self, *args, **kwargs): >> return super().dispatch(*args, **kwargs) >> &g

Re: How to use permissions on a CreateView class?

2019-05-29 Thread Ken Whitesell
om >> django.utils.decorators import method_decoratorfrom django.views.generic >> import TemplateView >> class ProtectedView(TemplateView): >> template_name = 'secret.html' >> >> @method_decorator(login_required) >> def dispatc

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Fellipe Henrique
uired) > def dispatch(self, *args, **kwargs): > return super().dispatch(*args, **kwargs) > > > On Tuesday, May 28, 2019 at 6:54:38 AM UTC-5, Fellipe Henrique wrote: >> >> Hello, >> >> I have these class, based on CreateView class... and I

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Jim Illback
patch(*args, **kwargs) On Tuesday, May 28, 2019 at 6:54:38 AM UTC-5, Fellipe Henrique wrote: Hello, I have these class, based on CreateView class... and I only want allow user with these permissions to add record... class ClienteCreateView(ERPbrViewMixin, CreateView): template_name =

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Joe Reitman
6:54:38 AM UTC-5, Fellipe Henrique wrote: > > Hello, > > I have these class, based on CreateView class... and I only want allow > user with these permissions to add record... > > class ClienteCreateView(ERPbrViewMixin, CreateView): > template_name = 'cadastro

How to use permissions on a CreateView class?

2019-05-28 Thread Fellipe Henrique
Hello, I have these class, based on CreateView class... and I only want allow user with these permissions to add record... class ClienteCreateView(ERPbrViewMixin, CreateView): template_name = 'cadastro/cliente/form.html' permission_required = ('cliente.can_open'

Re: Django permissions framework vs DRF permissions

2019-05-18 Thread Aldian Fazrihady
Hi, based on my experience, I can create DRF permission based on HTTP methods. Django permissions by default are tightly related to ORM models. DRF permission can be totally unrelated to ORM models. Regards, Aldian Fazrihady On Sat, 18 May 2019, 16:13 Rounak Jain, wrote: > Newbie here

Django permissions framework vs DRF permissions

2019-05-18 Thread Rounak Jain
Newbie here. I want to create hierarchical permissions in Django, very similar to one described here: https://stackoverflow.com/questions/49300215/django-hierarchy-permissions I have read about Django permissions framework and https://github.com/vintasoftware/django-role-permissions I don&#

Inherit permissions View (U.I.)

2019-05-17 Thread Rishi Dutta
How can I allow the company user say managers to grant access or revoke access from there junious. I want same view like permissions in user model. how can i inherit it exactly in my cutomized model. Thank you -- You received this message because you are subscribed to the Google Groups

Re: Advanced permissions and role creation

2019-04-25 Thread Balaji Shetty
> building anything complex and pretty much everything you need > > is already built-in in Django. > > > > > > > > On Sun, Apr 21, 2019 at 5:12 AM Joel Mathew > <mailto:j...@joel.su>> wrote: > > > >

Re: Advanced permissions and role creation

2019-04-25 Thread Mike Dewhirst
fic access to seperate areas (views), with some having restricted access. In addition, there are other hospitals who would be having no access to another hospital's records. All of these permissions should be customisable, and I should be able to create additio

Re: Advanced permissions and role creation

2019-04-24 Thread Mike Dewhirst
; wrote: I have an application for a hospital. There, I should be able to assign different roles like Doctor, Nurse, Attender, Auxillary Nurse, Pharmacist, Store Manager etc, each of would be having specific access to seperate areas (vie

Re: Advanced permissions and role creation

2019-04-23 Thread Balaji Shetty
ere, I should be able to assign >>> different roles like Doctor, Nurse, Attender, Auxillary Nurse, Pharmacist, >>> Store Manager etc, each of would be having specific access to seperate >>> areas (views), with some having restricted access. In addition, there are >>> ot

Re: Advanced permissions and role creation

2019-04-21 Thread Joel Mathew
Attender, Auxillary Nurse, Pharmacist, >> Store Manager etc, each of would be having specific access to seperate >> areas (views), with some having restricted access. In addition, there are >> other hospitals who would be having no access to another hospital's >> records

Re: Advanced permissions and role creation

2019-04-21 Thread Jani Tiainen
ews), with some having restricted access. In addition, there are > other hospitals who would be having no access to another hospital's > records. All of these permissions should be customisable, and I should be > able to create additional roles and permission groups for specific areas

Re: Advanced permissions and role creation

2019-04-20 Thread Mike Dewhirst
restricted access. In addition, there are other hospitals who would be having no access to another hospital's records. All of these permissions should be customisable, and I should be able to create additional roles and permission groups for specific areas later (from within the applic

Re: Advanced permissions and role creation

2019-04-20 Thread Sithembewena L. Dube
For roles and permissions management, I would stick with Django's Auth application (django.contrib.auth). It sounds like you ought to read up on how to design and build a multi-tenancy SaaS project in Django. I cannot recommend any one resource, so you'll have to do some searching an

Advanced permissions and role creation

2019-04-20 Thread Joel Mathew
hospitals who would be having no access to another hospital's records. All of these permissions should be customisable, and I should be able to create additional roles and permission groups for specific areas later (from within the application itself, in production). What would be the best sol

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-18 Thread Yevgeny Bar Lev
Thanks a lot, Simon! The delete and create sounds like the perfect solution in my case, since I don't have a lot of permissions assigned. Will try it now on a test case. On Mon, Mar 18, 2019 at 3:53 PM Simon Charette wrote: > > Would the following strategy work? delete all app per

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-18 Thread Simon Charette
> Would the following strategy work? delete all app permission and use, create_permissions to recreate them Yes, but that will delete all the user and group permissions as well; you'll have to reassign them. > How do I know to which db table a given permission points? Or does it

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-18 Thread Yevgeny Bar Lev
llo Yevgeny, > > I'd start by deleting your stale content types[0] which your permissions > are attached > to. That should deal with deleted model case. > > For the renames I suggest you drop into a shell and manually edit the > Permission.name > of the misnamed instances. &

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Simon Charette
Hello Yevgeny, I'd start by deleting your stale content types[0] which your permissions are attached to. That should deal with deleted model case. For the renames I suggest you drop into a shell and manually edit the Permission.name of the misnamed instances. Best, Simon [0]

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Yevgeny Bar Lev
Thanks Simon. Is there some nonmagical solution? I mean, is it possible to fix some of the permissions manually without breaking stuff? On Sun, Mar 17, 2019, 9:21 PM Simon Charette wrote: > Hello Yevgeny, > > I don't have magic solution to suggest to you given the current s

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Simon Charette
[0] https://code.djangoproject.com/ticket/29843 [1] https://github.com/django/django/pull/10540 Le dimanche 17 mars 2019 13:31:16 UTC-4, Yevgeny Bar Lev a écrit : > > Hello, > I have noticed that the available permissions list, which can be set to > users/groups in the admin doesn't match my

Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Yevgeny Bar Lev
Hello, I have noticed that the available permissions list, which can be set to users/groups in the admin doesn't match my models. This happened after a few standard migrations, where some models were renamed, some deleted, and new models were added. The list is basically not updated

Re: default groups and permissions

2019-01-08 Thread Nebojsa Hajdukovic
('IT utvecklare', 'IT utvecklare') >>> 14 ) >>> 15 objects = WiggenUserManager() >>> 16 dob = models.DateField(blank=True, null=True) >>> 17 employee_number = models.IntegerField(blank=True, null=True) >>> 1

Re: default groups and permissions

2019-01-08 Thread Robin Riis
27;, 'Verkstad'), >> 13 ('IT utvecklare', 'IT utvecklare') >> 14 ) >> 15 objects = WiggenUserManager() >> 16 dob = models.DateField(blank=True, null=True) >> 17 employee_number = models.IntegerField(blank=True, nul

Re: default groups and permissions

2019-01-07 Thread Nebojsa Hajdukovic
l=True) > 21 salary = models.IntegerField(blank=True, null=True) > > so when i add a new user with for example (title Verkstad) i want that > user to belong to the group verkstad.. > > where do i add that new group and set its permissions? i read somewhere > about signal bu

default groups and permissions

2019-01-06 Thread Robin Riis
xample (title Verkstad) i want that user to belong to the group verkstad.. where do i add that new group and set its permissions? i read somewhere about signal but it didnt say what to import or where to add it anyone got an idea? :) thnx in advance :) -- You received this message because yo

User permissions

2018-11-17 Thread Joel Mathew
How are you implementing user permission groups in your project? I'm using a model to store user and other models as foreign key and permissions as boolean? Is there a preferred module or standard way to do this? Sincerely yours, Joel G Mathew -- You received this message because yo

Re: Error in function to return permissions

2018-11-01 Thread Joel Mathew
Thank you! Sincerely yours, Joel G Mathew On Wed, 31 Oct 2018 at 21:36, Stephen J. Butler wrote: > > @login_required needs "request" as the first parameter. > > On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew wrote: >> >> I have a custom function to check if a user is authorized to do >> certain

Re: Error in function to return permissions

2018-10-31 Thread Stephen J. Butler
@login_required needs "request" as the first parameter. On Wed, Oct 31, 2018 at 11:58 AM Joel Mathew wrote: > I have a custom function to check if a user is authorized to do > certain functions: > > @login_required > def checkpermission(request, permiss): > username = request.user.username >

Error in function to return permissions

2018-10-31 Thread Joel Mathew
I have a custom function to check if a user is authorized to do certain functions: @login_required def checkpermission(request, permiss): username = request.user.username print(f"username is {username}") print(f"User.objects.filter() is {User.objects.filter()}") userobj = User.obje

Re: Django admin without Groups and Permissions. Can "groups and permissions" tables become a bottleneck?

2018-04-03 Thread Mike Dewhirst
On 4/04/2018 6:14 AM, Mateusz Kurowski wrote: I don't need groups and permissions, but i want to use django admin. Ive created this simple AbstractSuperUser that looks to solve this case. But i wonder if thats best idea. Can "groups and permissions" tables become a bottlenec

Django admin without Groups and Permissions. Can "groups and permissions" tables become a bottleneck?

2018-04-03 Thread Mateusz Kurowski
I don't need groups and permissions, but i want to use django admin. Ive created this simple AbstractSuperUser that looks to solve this case. But i wonder if thats best idea. Can "groups and permissions" tables become a bottleneck in the future even if i dont use any groups and

How to save user permissions from custom user edit form

2017-11-04 Thread DJ-Tom
7;) def __init__(self, *args, **kwargs): super(UsersForm, self).__init__(*args, **kwargs) self.fields['country'].required = False self.fields['user_permissions'].widget.attrs['class'] = 'input-xxlarge' self.fields['user_

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-18 Thread guettli
d procedures at least I would like to > know what specific bottlenecks did you stumble upon as I also use > object-level permissions extensively in my own project and haven't had any > performance issues yet. > > First I had stored procedures on my mind, but I talked to a postgre

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-17 Thread Vijay Khemlani
bject-level permissions extensively in my own project and haven't had any performance issues yet. If nothing else, your results would prove useful to the community. On Thu, Aug 17, 2017 at 10:18 AM, guettli wrote: > > > Am Mittwoch, 16. August 2017 13:39:53 UTC+2 schrieb Vijay

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-17 Thread guettli
Am Mittwoch, 16. August 2017 13:39:53 UTC+2 schrieb Vijay Khemlani: > > So, please share the specific numbers you got from your profiling. > > Why should I share the numbers? How would this help? -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-16 Thread Vijay Khemlani
So, please share the specific numbers you got from your profiling. On Wed, Aug 16, 2017 at 6:10 AM, guettli wrote: > > > Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: >> >> It's still implemented like that in the background, but I'm not sure why >> do you call it slow. >>

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-16 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Here are more docs about guardian being slow: http://django-guardian.readthedocs.io/en/stable/userguide/performance.html

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Freitag, 11. August 2017 10:05:00 UTC+2 schrieb James Schneider: > > >> My concern is that this python code can't return a queryset with all > items where a given permission+user tuple match. > > > def has_perm(obj, user): > if user.is_superuser: > return True > > This means I nee

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Did you run benchmarks? Profiling? > > Usually your own business logic will be the bottleneck of your > application, not

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread James Schneider
> My concern is that this python code can't return a queryset with all items where a given permission+user tuple match. def has_perm(obj, user): if user.is_superuser: return True This means I need a SQL WHERE condition For example MyModel.objects.filter(Q(...)|Q()) I never want

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-10 Thread Vijay Khemlani
It's still implemented like that in the background, but I'm not sure why do you call it slow. Did you run benchmarks? Profiling? Usually your own business logic will be the bottleneck of your application, not your permission checking. On Thu, Aug 10, 2017 at 5:15 AM, guettli wrote: > > > Am Mi

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-10 Thread guettli
Am Mittwoch, 9. August 2017 18:03:44 UTC+2 schrieb Vijay Khemlani: > > > https://django-guardian.readthedocs.io/en/stable/userguide/check.html#get-objects-for-user > > projects = get_objects_for_user(request.user, 'projects.view_project') > > > Thank you for providing this link. I guess it is new

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread Vijay Khemlani
https://django-guardian.readthedocs.io/en/stable/userguide/check.html#get-objects-for-user projects = get_objects_for_user(request.user, 'projects.view_project') On Wed, Aug 9, 2017 at 10:55 AM, guettli wrote: > > > Am Mittwoch, 9. August 2017 10:04:25 UTC+2 schrieb James Schneider: > >> >> >>

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Mittwoch, 9. August 2017 10:46:10 UTC+2 schrieb James Schneider: > > Sorry for the duplicate, accidently hit send before I was done, finished > below. > > On Aug 3, 2017 1:08 AM, "guettli" > wrote: > > First I asked a similar question on the postgresql-general list. The > discussion[1] has s

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Mittwoch, 9. August 2017 10:04:25 UTC+2 schrieb James Schneider: > > > > On Aug 3, 2017 1:08 AM, "guettli" > wrote: > > First I asked a similar question on the postgresql-general list. The > discussion[1] has settled there. > > Now I would love the hear what you think. > > > I am thinking abo

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Montag, 7. August 2017 14:48:54 UTC+2 schrieb Vijay Khemlani: > > I use django-guardian for object level permissions and it works > surprisingly well > Good to hear this. I will have a look at it. > > On Mon, Aug 7, 2017 at 4:59 AM, Antonis Christofides < > ant

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
Am Montag, 7. August 2017 09:55:45 UTC+2 schrieb Mike Morris: > > I have no expertise in the field, but I've chosen not to let that stop me > from making a suggestion :-) > > How about splitting the difference: > >1. Assign & track permissions on the applicatio

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread guettli
h application user is > logged in. That would mean updating users and permissions in the database > every time it changes on the application level. I think this would add a > lot of complexity that you really don't want. > > Using the postgres users would be possible, but li

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread James Schneider
Sorry for the duplicate, accidently hit send before I was done, finished below. On Aug 3, 2017 1:08 AM, "guettli" wrote: First I asked a similar question on the postgresql-general list. The discussion[1] has settled there. Now I would love the hear what you think. I am thinking about rewritin

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-09 Thread Antonis Christofides
> middle that runs very early middleware Antonis Christofides http://djangodeployment.com On 2017-08-09 11:15, Antonis Christofides wrote: > > Hi, > >> - You'll almost certainly take a performance hit when connecting to the >> database. If each connection to the DB is using a different user, then

  1   2   3   4   5   6   7   >