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.
source code
 
GetId(self)
Return the user ID of this user.
source code
 
GetRole(self)
Return the role of this user.
source code
 
IsEnabled(self)
Return true if this account is enabled.
source code
 
GetConfigurationProperty(self, name, default=None)
Return a configuration property.
source code
 
SetConfigurationProperty(self, name, value)
Set the configuration property 'name' to 'value'.
source code
 
GetInfoProperty(self, name, default=None)
Return an informational property.
source code
 
SetInfoProperty(self, name, value)
Set the informational property 'name' to 'value'.
source code
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.

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.

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.