Definition at line 63 of file usermgmt.h.
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.
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.
userId | Object id of the user. | |
module | OSB module of rootTag. | |
rootTag | Access identifier of the root window. |
bool OSB_LIB::UserMgmtCfg::allowed | ( | const OsbUser::Oid & | userId, | |
const ModuleId & | module | |||
) |
Check if a user has access to a module.
userId | Object id of the user. | |
module | OSB module to verify. |
void OSB_LIB::UserMgmtCfg::expModuleAccess | ( | std::ostream & | os | ) | const |
Export module access rights, CSV format.
os | Stream to write to. |
object id, module, access tag, parent_id
.
const UserGroup& OSB_LIB::UserMgmtCfg::get | ( | const UserGroup::Oid & | grpId | ) | const |
Get a user group.
grpId | The object id of the user group. |
ObjectNotFound | if the user group is not found. |
const OsbUser& OSB_LIB::UserMgmtCfg::get | ( | const OsbUser::Oid & | userId | ) | const |
Get an OSB user.
userId | The object id of the user. |
ObjectNotFound | if the user is not found. |
Get a specific OSB module.
id | The id of the module to retrieve. |
ObjectNotFound | if the module does not exist. |
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.
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. |
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.
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. |
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.
session | Database session to use. | |
user | OSB user to login: login name and password must be set. |
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.
session | Database session to use. | |
userId | The id of the user to read. |
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.
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.
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. |
bool OSB_LIB::UserMgmtCfg::remove | ( | const OSB_DB::Session & | session, | |
const OsbUser::Oid | userId | |||
) |
Remove a user from the list.
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. |
void OSB_LIB::UserMgmtCfg::remove | ( | const OSB_DB::Session & | session, | |
ModAccess | access | |||
) |
Remove a module access right and all its children.
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.
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. |
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.
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. |
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?
friend struct Destroy [friend] |
Destroy OSB_LIB::UserMgmtCfg::destroy_ [static, private] |
UserGroups OSB_LIB::UserMgmtCfg::groups_ [private] |
UserMgmtCfg* OSB_LIB::UserMgmtCfg::instance_ [static, private] |
Modules OSB_LIB::UserMgmtCfg::modules_ [private] |
Users OSB_LIB::UserMgmtCfg::users_ [private] |