I've done something similar for my own personal project and i can share how
i did it:

I used the Django User.
And then created a ProfileDetails model that has a OneToOneField with User.
An Organization Model
An Employee Model - Contains FK to Organization and User

Also, i did implemented my own permission scheme wherein the Admin of an
Org can setup permissions for the Org. For eg. whether an Item can be
shared amongst user or each user can only view what they have created etc,
So, every time an Item has accessed i check the Org setting for this
'sharing' permission and then return.


if SHARED_WORKSPACE == 1:
  items =
Items.objects.filter(created_by__employees__org__in=self.employees_set.all().values_list('org')).filter(status="AVAILABLE")
else:
  items = Item.objects.filter(created_by=self)

I am in the process of finetuning this method and make things more robust,
for if i want to check the access level on an Item for a particular logged
in Employee, i have to first get the Org, and then the Org Level Permission
setting(which obviously can be cached) and then check the Item.

Venkat

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to