Package qm :: Module user
[hide private]
[frames] | no frames]

Module user

source code

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.

Classes [hide private]
  AuthenticationError
  XmlDatabaseError
  AccountDisabledError
  User
A user account record.
  Group
A group of users.
  Authenticator
Base class for authentication classes.
  DefaultDatabase
  DefaultAuthenticator
Authenticator for only a single user, "default_user".
  XmlDatabase
An XML user database.
  XmlDatabaseAuthenticator
An authenticator based on contents of the XML user database.
Functions [hide private]
 
load_xml_database(path)
Load users from XML database at 'path' and set up authenticator.
source code
 
get_user_from_dom(user_node)
Construct a 'User' object from a user DOM element.
source code
 
_get_dom_properties(node, tag)
Return a dictionary of properties from a user DOM element node.
source code
 
create_dom_for_user(document, user)
Create a DOM element node for 'user'.
source code
 
_create_dom_properties(element, properties)
Add user properties to a DOM element.
source code
 
get_group_from_dom(group_node)
Construct a 'Group' object from a DOM element.
source code
 
create_dom_for_group(document, group)
Create a DOM element node for 'group'.
source code
Variables [hide private]
  xml_user_database_dtd = '-//Software Carpentry//User Database ...
  database = DefaultDatabase()
  authenticator = DefaultAuthenticator()
  __package__ = 'qm'
Function Details [hide private]

get_user_from_dom(user_node)

source code 

Construct a 'User' object from a user DOM element.

'user_node' -- A "user" DOM element.

returns -- A 'User' object.

_get_dom_properties(node, tag)

source code 

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_user(document, user)

source code 

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.

_create_dom_properties(element, properties)

source code 

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_group_from_dom(group_node)

source code 

Construct a 'Group' object from a DOM element.

'group_node' -- A DOM "group" element node.

returns -- A 'Group' object.

create_dom_for_group(document, group)

source code 

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.


Variables Details [hide private]

xml_user_database_dtd

Value:
'-//Software Carpentry//User Database V0.1//EN'