Table of Contents

Module: user qm/user.py

User management facilities.

Access to this module is primarily through two global variables.

database
The user database. The database contains objects representing users, accessed via a user ID. The user ID is a label uniquely identifying the user in the system.

The user database also provides a notion of user groups. Each group is identified by a group ID, and contains zero or more user IDs. A user may belong to more than one group. A group may not contain other groups.

authenticator
The authenticator object by which the application authenticates users who attempt to access it via various channels.

Access the database object via this interface:

  • Use the database object as a Python map from user IDs to User objects. The keys method returns a sequence of user IDs in the database.

  • Call GetGroupIds to return a sequence of group IDs. Use the GetGroup method to retrieve a Group object for a given group ID.

Functions   
_create_dom_properties
_get_dom_properties
create_dom_for_group
create_dom_for_user
get_group_from_dom
get_user_from_dom
load_xml_database
  _create_dom_properties 
_create_dom_properties ( element,  properties )

Add user properties to a DOM element.

element
A DOM element node to which properties are to be added as children.
properties
A map from property names to values.
  _get_dom_properties 
_get_dom_properties ( node,  tag )

Return a dictionary of properties from a user DOM element node.

node
A "user" DOM element.
tag
The tag of the child element in which to look for properties.
returns
A map from property names to values.
  create_dom_for_group 
create_dom_for_group ( document,  group )

Create a DOM element node for group.

document
The DOM document object in which to create the element.
group
A Group instance.
returns
A DOM element node.
  create_dom_for_user 
create_dom_for_user ( document,  user )

Create a DOM element node for user.

document
The DOM document object in which to create the element.
user
A User instance.
returns
A DOM element node.
  get_group_from_dom 
get_group_from_dom ( group_node )

Construct a Group object from a DOM element.

group_node
A DOM "group" element node.
returns
A Group object.
  get_user_from_dom 
get_user_from_dom ( user_node )

Construct a User object from a user DOM element.

user_node
A "user" DOM element.
returns
A User object.
  load_xml_database 
load_xml_database ( path )

Load users from XML database at path and set up authenticator.

Classes   

AccountDisabledError

AuthenticationError

Authenticator

Base class for authentication classes.

DefaultAuthenticator

Authenticator for only a single user, "default_user".

DefaultDatabase

Group

A group of users.

User

A user account record.

XmlDatabase

An XML user database.

XmlDatabaseAuthenticator

An authenticator based on contents of the XML user database.

XmlDatabaseError


Table of Contents

This document was automatically generated on Mon Jan 3 09:42:29 2005 by HappyDoc version 2.1