Package expedient :: Package clearinghouse :: Package roles :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Created on Aug 9, 2010


Author: jnaous

Functions [hide private]
QuerySet of django.contrib.auth.models.User
get_users_for_role(role, can_delegate=False)
Get all the users that have the role.
source code
Variables [hide private]
  __package__ = 'expedient.clearinghouse.roles'
Function Details [hide private]

get_users_for_role(role, can_delegate=False)

source code 

Get all the users that have the role.

This function does a lookup by the permissions the users have rather by whether or not they were given the role explicitly. It is much slower.

Parameters:
  • role (instance of ProjectRole) - role whose users we are looking for.
  • can_delegate (bool) - Should we look only for users who can delegate the role? Default is False.
Returns: QuerySet of django.contrib.auth.models.User
users that can own the role