Hi,

I am having difficulty getting my thoughts around my problem.

Given users (managerial, different levels) and depots/regional offices.

line_mangers should only see list of staff assigned to line_mangers group.

middle_managers should only see list of staff assigned from '1 to n' 
line_managers.

senior_manages should only see  list of staff assigned from '1 to 
n'  middle_managers in senior_manages depot/regional office.

executive_managers should see an overview of staff assigned 
to depots/regional offices.

I am looking at django-authority but it is unclear to me if this will work.

Q1. is what I seek row_object permissions, I am unsure of the terminology, 
I cannot get a understanding that I could explain to my grandmother. 

Q2. is it possible to have in my views.py a def that says something like
      if logged_in_user == manager_level and  is_assigned_office == 
office_n then view_only_staff_details == work_group and  region_office


models.py

class Employee(models.Model):
    first_name = models.CharField(max_length=75)
    surname = models.CharField(max_length=75)
    mname           = models.CharField(max_length=75, blank=True, null=True)

    def fullname(self):
        return '%s %s' % (self.first_name, self.surname)
    fullname = property(fullname)        

    def get_current_region(self):
eds = self.employeedynamic_set.filter(is_current=True)
if len(eds) > 1:
    return "Error more than one current depot for %s." % (self)
else:
    return eds[0].depot.region.name

class EmployeeDynamic(models.Model):
    employee = models.ForeignKey(Employee)    
    address = models.ForeignKey(Address)
    region         = models.ForeignKey(Region)
    depot         = models.ForeignKey(Depot)
    is_current = models.BooleanField()

I have sorted authenticated login by using django-userena 

Tommy.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d867e076-bcc7-44da-aa70-34cdf1d4013a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to