Package expedient :: Package common :: Package permissions :: Package templatetags :: Module permissions
[hide private]
[frames] | no frames]

Module permissions

source code

Created on Aug 3, 2010


Author: jnaous

Functions [hide private]
 
has_obj_perm(obj_or_class, perm_name)
Return a queryset of all permittees that own the permission with name perm_name for target obj_or_class.
source code
 
as_class(permittee_qs, klass)
Get the permittee queryset as a queryset of model class klass.
source code
Variables [hide private]
  register = template.Library()
  __package__ = 'expedient.common.permissions.templatetags'
Function Details [hide private]

has_obj_perm(obj_or_class, perm_name)

source code 

Return a queryset of all permittees that own the permission with name perm_name for target obj_or_class.

Decorators:
  • @register.filter

as_class(permittee_qs, klass)

source code 

Get the permittee queryset as a queryset of model class klass.

Only those objects whose class is klass are returned.

Parameters:
  • permittee_qs - Permitte queryset to filter.
  • klass - class or ContentType to filter for.
Decorators:
  • @register.filter