Package turbogears :: Package identity

Package identity

source code

The TurboGears identity management package.

Submodules

Classes
  SecureResource
  not_anonymous
Predicate for checking whether current visitor is anonymous.
  Predicate
Generic base class for testing true or false for a condition.
  in_any_group
Predicate for requiring membership in at least one group.
  in_all_groups
Predicate for requiring membership in a number of groups.
  has_all_permissions
Predicate for checking whether the visitor has all permissions.
  All
Logical 'and' of all sub-predicates.
  in_group
Predicate for requiring a group.
  from_any_host
Predicate for checking the visitor against a number of allowed hosts.
  SecureObject
  has_any_permission
Predicate for checking whether visitor has at least one permission.
  CompoundPredicate
A predicate composed of other predicates.
  from_host
Predicate for checking whether the visitor's host is a permitted host.
  has_permission
Predicate for checking whether visitor has a particular permission.
  Any
Logical 'or' of all sub-predicates.
  IdentityPredicateHelper
A mix-in helper class for Identity Predicates.
  RequestRequiredException
No request present.
  IdentityManagementNotEnabledException
User forgot to enable Identity management.
  IdentityConfigurationException
Incorrect configuration.
  IdentityException
Base class for all Identity exceptions.
  IdentityFailure
Identity failure.
Functions
 
encrypt_password(cleartext) source code
 
create_default_provider()
Create default identity provider.
source code
 
was_login_attempted() source code
 
set_current_provider(provider) source code
 
set_current_identity(identity) source code
 
require(predicate, obj=None)
Function decorator checking requirements for the current user.
source code
 
set_identity_errors(errors) source code
 
get_failure_url(errors=None) source code
 
get_identity_errors() source code
Variables
  current_provider = ProviderWrapper()
  current = IdentityWrapper()
Function Details

create_default_provider()

source code 

Create default identity provider.

Creates an identity provider according to what is found in the configuration file for the current TurboGears application

Returns an identity provider instance or raises an IdentityConfigurationException.

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.