Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 27, 2005 01:56:40

David A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Per-user data: any pointers?


I'm trying to figure out how best to do per-user data (think of the relationship between users and her photos on flickr).I notice that there's a nifty concept of "permissions", which in some ways is per-user binary data.  There is also the mostly undocumented (?) get_profile() call, which might or might not be relevant.Is the right thing for me to do to dig into the sites & the concept of profile?In this particular app, there is no need for any one user to need to be able to view any other user's data.I can do it all "by hand" by looking through a big table indexing by userid, but I'm wondering if there's a Best Practice out there that I should know about before I start building my own infrastructure....Cheers,--david

Offline

#2 Nov. 27, 2005 13:44:34

Robert W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Per-user data: any pointers?


David Ascher wrote:
> I'm trying to figure out how best to do per-user data (think of the
> relationship between users and her photos on flickr).
>
> I notice that there's a nifty concept of "permissions", which in some ways
> is per-user binary data. There is also the mostly undocumented (?)
> get_profile() call, which might or might not be relevant.
>
> Is the right thing for me to do to dig into the sites & the concept of
> profile?
>
> In this particular app, there is no need for any one user to need to be able
> to view any other user's data.
>
> I can do it all "by hand" by looking through a big table indexing by userid,
> but I'm wondering if there's a Best Practice out there that I should know
> about before I start building my own infrastructure....
>
> Cheers,
>
> --david
>

The best way to do this is to have a ForeignKey to auth.User on the top
level object of your per user data.

And then do the permission checking in your view functions. This can be
eased by adding custom functions to your model.

The permissions atm do not deal with anything more granular than a
class/table level.

You might want to look back in the archives for the ACL flamewar,http://groups.google.co.uk/group/django-developers/browse_thread/thread/7dca63383b948d7b/2a179f3917372882?q=acl&rnum=1#2a179f3917372882I do hope to fix this in a sensible way eventually with a default model
oriented security system, with mixins providing an easy way to add crazy
things like ACL systems. But probably not for 1.0 .

Offline

#3 Nov. 27, 2005 18:05:41

David A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Per-user data: any pointers?


On 11/27/05,Robert Wittams<> wrote:The best way to do this is to have a ForeignKey to auth.User on the toplevel object of your per user data.Thanks, that's what I ended up doing last night.And then do the permission checking in your view functions. This can beeased by adding custom functions to your model.The permissions atm do not deal with anything more granular than aclass/table level.In my case, I don't think it'll be a problem.You might want to look back in the archives for the ACL flamewar,http://groups.google.co.uk/group/django-developers/browse_thread/thread/7dca63383b948d7b/2a179f3917372882?q=acl&rnum=1#2a179f3917372882I do hope to fix this in a sensible way eventually with a default modeloriented security system, with mixins providing an easy way to add crazythings like ACL systems. But probably not for 1.0 .Luckily, I don't think I care yet =).Thanks.  (BTW, what's the site_profile concept?)--david

Offline

Board footer

Moderator control

Enjoy the 24th of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support