OSB_LIB::UserMgmtCfg Class Reference

Collaboration diagram for OSB_LIB::UserMgmtCfg:

Collaboration graph
[legend]
List of all members.

Detailed Description

Management of OSB modules, users, groups and access rights.

Definition at line 63 of file usermgmt.h.

Public Member Functions

Evaluation of access rights.
Information about OSB modules.
Maintain module access rights:
User management.
User group management.
Group access rights.

Static Public Member Functions

Private Member Functions

Private Attributes

Static Private Attributes

Friends

Classes


Constructor & Destructor Documentation

OSB_LIB::UserMgmtCfg::UserMgmtCfg (  )  [private]

Private construction only.

OSB_LIB::UserMgmtCfg::~UserMgmtCfg (  )  [private]

Private destruction only.

OSB_LIB::UserMgmtCfg::UserMgmtCfg ( const UserMgmtCfg  )  [private]

Prevent copying: not implemented.


Member Function Documentation

bool OSB_LIB::UserMgmtCfg::allowed ( const OsbUser::Oid userId,
const ModuleId module,
const std::string &  rootTag 
)

Check if a user has access to a root window.

Parameters:
userId Object id of the user.
module OSB module of rootTag.
rootTag Access identifier of the root window.
Returns:
true if the user is allowed to access the window as identified by rootTag, else false.

bool OSB_LIB::UserMgmtCfg::allowed ( const OsbUser::Oid userId,
const ModuleId module 
)

Check if a user has access to a module.

Parameters:
userId Object id of the user.
module OSB module to verify.
Returns:
true if the user is allowed to access module, else false.

void OSB_LIB::UserMgmtCfg::expModuleAccess ( std::ostream &  os  )  const

Export module access rights, CSV format.

Parameters:
os Stream to write to.
Writes the module access rights to os, one per line:
object id, module, access tag, parent_id.

const UserGroup& OSB_LIB::UserMgmtCfg::get ( const UserGroup::Oid grpId  )  const

Get a user group.

Parameters:
grpId The object id of the user group.
Returns:
The user group for grpId.
Exceptions:
ObjectNotFound if the user group is not found.

const OsbUser& OSB_LIB::UserMgmtCfg::get ( const OsbUser::Oid userId  )  const

Get an OSB user.

Parameters:
userId The object id of the user.
Returns:
The OSB user for userId.
Exceptions:
ObjectNotFound if the user is not found.

const Module& OSB_LIB::UserMgmtCfg::get ( ModuleId  id  )  const

Get a specific OSB module.

Parameters:
id The id of the module to retrieve.
Exceptions:
ObjectNotFound if the module does not exist.
Returns:
The module for id.

const UserGroups& OSB_LIB::UserMgmtCfg::groups (  )  const

Get all user groups.

void OSB_LIB::UserMgmtCfg::insert ( const OSB_DB::Session session,
GrpAccess access 
)

Add or replace an access right for a user group.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions.
access Group access to add or replace,
for new access rights the object id is set.
Exceptions:
ObjectNotFound if the user group of access does not exist.
OsbException from GrpAccessMap::check().

void OSB_LIB::UserMgmtCfg::insert ( const OSB_DB::Session session,
ModAccess access 
)

Add or replace an access right for a module.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions.
access Module access to add or replace,
for new access rights the object id is set.
Exceptions:
ObjectNotFound if the module of access does not exist.
OsbException from ModAccessMap::check().

static UserMgmtCfg& OSB_LIB::UserMgmtCfg::instance (  )  [static]

Get the only instance of the class.

bool OSB_LIB::UserMgmtCfg::login ( const OSB_DB::Session session,
OsbUser user 
)

Login an OSB user.

Parameters:
session Database session to use.
user OSB user to login:
login name and password must be set.
Returns:
true if the user is logged in, else false.
The function reads the user from database and valiates the password.
At the same time user management loads the user groups that are granted to the user.

const Modules& OSB_LIB::UserMgmtCfg::modules (  )  const

Get all OSB modules.

const OsbUser& OSB_LIB::UserMgmtCfg::read ( const OSB_DB::Session session,
const OsbUser::Oid userId 
)

Read OSB user from the database.

Parameters:
session Database session to use.
userId The id of the user to read.
Exceptions:
ObjectNotFound if the user does not exist in the database.

void OSB_LIB::UserMgmtCfg::readGroupAccess ( const OSB_DB::Session session,
const ModuleId  moduleId 
) [private]

Read group access rights for a specific module.

Reads the access rights for each user group who's module is moduleId.

void OSB_LIB::UserMgmtCfg::readGroups ( const OSB_DB::Session session  ) 

Read the OSB modules from the database.

The function only reads the group descriptions (id, name et al.), call readGroupAccess() to read the access rights as well.

void OSB_LIB::UserMgmtCfg::readModuleAccess ( const OSB_DB::Session session  ) 

Read OSB modules and access rights from the database.

Calls readModules() and then reads the access rights for each module.

void OSB_LIB::UserMgmtCfg::readModules ( const OSB_DB::Session session  ) 

Read the OSB modules from the database.

The function only reads the module descriptions (name, type), call readModuleAccess() to read the access rights as well.

void OSB_LIB::UserMgmtCfg::readUsers ( const OSB_DB::Session session  ) 

Read the users from the database.

void OSB_LIB::UserMgmtCfg::remove ( const OSB_DB::Session session,
GrpAccess  access 
)

Remove a group access right and all its children.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions.
access User group access to remove.

bool OSB_LIB::UserMgmtCfg::remove ( const OSB_DB::Session session,
const UserGroup::Oid  grpId 
)

Remove a group from the list.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions if the function returns true.
grpId The object id of the user group to remove.
Returns:
true if the group was removed from the database and the internal list, else false.
In either case the group does no more exist in the internal list after the function returns.

bool OSB_LIB::UserMgmtCfg::remove ( const OSB_DB::Session session,
const OsbUser::Oid  userId 
)

Remove a user from the list.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions if the function returns true.
userId The object id of the user to remove.
Returns:
true if the user was removed from the database and the internal list, else false.
In either case the user does no more exist in the internal list after the function returns.

void OSB_LIB::UserMgmtCfg::remove ( const OSB_DB::Session session,
ModAccess  access 
)

Remove a module access right and all its children.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions.
access Module access to remove.

void OSB_LIB::UserMgmtCfg::save ( const OSB_DB::Session session,
UserGroup grp 
)

Insert a group into the list.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions.
grp The user group to save, it replaces an already existing group with the same object id.
After the function returns grp is a copy of the user group stored internally.
Exceptions:
OsbException from UserGroup::save() if the user group can not be saved.

void OSB_LIB::UserMgmtCfg::save ( const OSB_DB::Session session,
OsbUser user 
)

Update an OSB user.

Parameters:
session Database session to use.
The caller is reponsible to commit the transactions.
user The user to save, it replaces an already existing user with the same object id.
After the function returns user is a copy of the user stored internally.
Exceptions:
OsbException from OsbUser::insert() or OsbUser::update if the user can not be saved.

const Users& OSB_LIB::UserMgmtCfg::users (  )  const

Get all loaded users.

bool OSB_LIB::UserMgmtCfg::usersRead (  )  const

All users read from the database?


Friends And Related Function Documentation

friend struct Destroy [friend]

Allow to delete instance_.

Definition at line 380 of file usermgmt.h.


Member Data Documentation

Destroy OSB_LIB::UserMgmtCfg::destroy_ [static, private]

Make sure the instance is deleted at program end.

Definition at line 394 of file usermgmt.h.

UserGroups OSB_LIB::UserMgmtCfg::groups_ [private]

List of OSB user groups.

Definition at line 388 of file usermgmt.h.

UserMgmtCfg* OSB_LIB::UserMgmtCfg::instance_ [static, private]

The only instance of the class.

Definition at line 392 of file usermgmt.h.

Modules OSB_LIB::UserMgmtCfg::modules_ [private]

List of OSB modules.

Definition at line 384 of file usermgmt.h.

Users OSB_LIB::UserMgmtCfg::users_ [private]

List of OSB users.

Definition at line 386 of file usermgmt.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:13:41 2006 for OSB Library by  doxygen 1.4.7