qm :: user :: User :: Class User
[hide private]
[frames] | no frames]

Class User
source code

A user account record.

User accounts contain three sets of properties.  Each property
is a name-value pair.  The three sets of properties are:

  informational properties -- General information about the
  user.  This may include the user's real name, contact
  information, etc.  These properties are generally
  user-visible, and should be modified only at the user's
  request.

  configuration properties -- Program-specific per-user
  configuration.  This includes user's preferences, such as
  preferred layout and output options.  These properties are
  typically hidden as implementation details, and are often
  changed implicitly as part of other operations.

  authentication properties -- Information used to authenticate
  the user.  This may include such things as passwords, PGP
  keys, and digital certificates.  There are no accessors for
  these properties; they should be used by authenticators only.



Instance Methods [hide private]
  __init__(self, user_id, role="user", enabled=1, information_properties={}, configuration_properties={}, authentication_properties={})
Create a new user account.
  GetId(self)
Return the user ID of this user.
  GetRole(self)
Return the role of this user.
  IsEnabled(self)
Return true if this account is enabled.
  GetConfigurationProperty(self, name, default=None)
Return a configuration property.
  SetConfigurationProperty(self, name, value)
Set the configuration property 'name' to 'value'.
  GetInfoProperty(self, name, default=None)
Return an informational property.
  SetInfoProperty(self, name, value)
Set the informational property 'name' to 'value'.

Method Details [hide private]

__init__(self, user_id, role="user", enabled=1, information_properties={}, configuration_properties={}, authentication_properties={})
(Constructor)

source code 

Create a new user account.

'user_id' -- The ID for the user.

'role' -- If "default", this is the default user account (there should be only one). The default account, if provided, is used for otherwise unauthenticated operations. If "admin", this is an administrator account. If "user", this is an ordinary user account.

'enabled' -- If true, this account is enabled; otherwise, disabled.

'information_properties' -- A map contianing information properties.

'configuration_properties' -- A map containing configuration properties.

'authentication_properties' -- A map containing authentication properties.

GetId(self)

source code 
Return the user ID of this user.

GetRole(self)

source code 
Return the role of this user.

IsEnabled(self)

source code 
Return true if this account is enabled.

GetConfigurationProperty(self, name, default=None)

source code 

Return a configuration property.

'name' -- The name of the property.

'default' -- The value to return if this property is not specified for the user account.

SetConfigurationProperty(self, name, value)

source code 
Set the configuration property 'name' to 'value'.

GetInfoProperty(self, name, default=None)

source code 

Return an informational property.

'name' -- The name of the property.

'default' -- The value to return if this property is not specified for the user account.

SetInfoProperty(self, name, value)

source code 
Set the informational property 'name' to 'value'.