Package turbogears :: Package identity :: Module conditions

Module conditions

source code

Definition of the identity predicates.

Classes
  Predicate
Generic base class for testing true or false for a condition.
  CompoundPredicate
A predicate composed of other predicates.
  All
Logical 'and' of all sub-predicates.
  Any
Logical 'or' of all sub-predicates.
  NotAny
Locigal 'nor' of all sub-predicates.
  IdentityPredicateHelper
A mix-in helper class for Identity Predicates.
  in_group
Predicate for requiring a group.
  in_all_groups
Predicate for requiring membership in a number of groups.
  in_any_group
Predicate for requiring membership in at least one group.
  not_anonymous
Predicate for checking whether current visitor is anonymous.
  has_permission
Predicate for checking whether visitor has a particular permission.
  has_all_permissions
Predicate for checking whether the visitor has all permissions.
  has_any_permission
Predicate for checking whether visitor has at least one permission.
  from_host
Predicate for checking whether the visitor's host is a permitted host.
  from_any_host
Predicate for checking the visitor against a number of allowed hosts.
  SecureResource
  SecureObject
Functions
 
require(predicate, obj=None)
Function decorator checking requirements for the current user.
source code
Function Details

require(predicate, obj=None)

source code 

Function decorator checking requirements for the current user.

This function decorator checks whether the current user is a member of the groups specified and has the permissions required.