Opened 16 years ago

Closed 15 years ago

Last modified 13 years ago

#11010 closed (fixed)

Add a foundation for rowlevel permissions in Django

Reported by: Florian Apolloner Owned by: Jannis Leidel
Component: contrib.auth Version: dev
Severity: Keywords:
Cc: Jannis Leidel, contact@…, vinilios@…, Florian Apolloner, nabucosound, Alexander Koshelev, mpjung@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Many sites would like to use rowlevel permissions, but it's not that easy to do that with Django currently. The minimal requirement would be to add that support to the usermodel and the auth backends. This would enable us to write our own rowlevel implementations easily.

I added a patch, where the only relevant change is that the backends need to support obj as last parameter; I don't like the idea of making that optional as I prefer it consistent. Although if you prefer another option, just tell me, this patch (although working) is more or less a concept of what's needed to be done.

Attachments (3)

rowlevel_permissions-r10674.diff (8.2 KB ) - added by Florian Apolloner 16 years ago.
rowlevel_perms@12123_#11010.diff (16.6 KB ) - added by Florian Apolloner 15 years ago.
object_permissions_r11712_#11010.diff (12.8 KB ) - added by Florian Apolloner 15 years ago.

Download all attachments as: .zip

Change History (26)

by Florian Apolloner, 16 years ago

comment:1 by Chris Beaven, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:2 by Thomas Güttler, 15 years ago

Cc: hv@… added

comment:3 by Jannis Leidel, 15 years ago

Cc: Jannis Leidel added
Has patch: set
Needs tests: set

comment:4 by Jannis Leidel, 15 years ago

Needs documentation: set
Patch needs improvement: set
Triage Stage: Design decision neededAccepted

Setting to accepted after talking to jacobian and apollo13 in #django-dev.

comment:5 by contact@…, 15 years ago

I made my own row level permission system based on this patch. It's still in a very early stage, but if needed I can share my findings.

comment:6 by anonymous, 15 years ago

Cc: contact@… added

comment:7 by anonymous, 15 years ago

Cc: vinilios@… added

in reply to:  5 comment:8 by Florian Apolloner, 15 years ago

Replying to contact@roelkramer.nl:

I made my own row level permission system based on this patch. It's still in a very early stage, but if needed I can share my findings.

Hi, I am working on this patch for 1.2 and it would be nice if you could share your backend; maybe we find something else to include or improve…

comment:9 by Florian Apolloner, 15 years ago

Owner: changed from nobody to Florian Apolloner

comment:10 by Florian Apolloner, 15 years ago

Cc: Florian Apolloner added

comment:11 by nabucosound, 15 years ago

Cc: nabucosound added

by Florian Apolloner, 15 years ago

comment:12 by Florian Apolloner, 15 years ago

Updated the patch after talking to jacob on irc, the deprecation ploicy is described too. Also moved tests from doctest to unittest

comment:13 by Alexander Koshelev, 15 years ago

Cc: Alexander Koshelev added

comment:14 by Michael P. Jung, 15 years ago

Cc: mpjung@… added

by Florian Apolloner, 15 years ago

comment:15 by Florian Apolloner, 15 years ago

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

nearing „ready for checkin“ after talking to jacob again I guess ;)

comment:16 by Jacob, 15 years ago

Owner: changed from Florian Apolloner to Jacob
Status: newassigned
Triage Stage: AcceptedReady for checkin

comment:17 by xonatius, 15 years ago

What about anonymous user? It still return False on has_perm?

comment:18 by Jannis Leidel, 15 years ago

Owner: changed from Jacob to Jannis Leidel
Status: assignednew

Taking this ticket in preparation for sprint.

comment:19 by Jannis Leidel, 15 years ago

Resolution: fixed
Status: newclosed

(In [11807]) Fixed #11010 - Add a foundation for object permissions to authentication backends. Thanks to Florian Apolloner for writing the initial patch.

comment:20 by Oroku Saki, 15 years ago

Will this be what's needed for security only (ie, block people without permissions to see some object), or will it help people who are developing SAAS with an Account model who have been going SomeModel.objects.filter(account=request.account)? Or, will this only work with the built in Auth system?

comment:21 by Florian Apolloner, 15 years ago

This ticket is closed and trac isn't for discussion, plz redirect your question to the appropriate mailing list

comment:22 by Thomas Güttler, 14 years ago

Cc: hv@… removed

comment:23 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top