OSB_LIB::UserGroup Class Reference

Collaboration diagram for OSB_LIB::UserGroup:

Collaboration graph
[legend]
List of all members.

Detailed Description

OSB user group.

A user group defines access rights for one Module.

For an application several groups with different access rights may be defined.
A user can belong only to one group of a given application.

See also:
UserMgmtCfg Manager class to create, modify or delete user groups.
Todo:
For common resources (such as InventoryPool) is should be possible to create a user group for the virtual module All and to grant it to a user.

Definition at line 83 of file osbusrgrp.h.

Database operations:

Public Types

Public Member Functions

Read access:
Write access:

Private Member Functions

Private Attributes

Friends


Member Typedef Documentation

typedef Id<UserGroup> OSB_LIB::UserGroup::Oid

Object id.

Definition at line 90 of file osbusrgrp.h.


Constructor & Destructor Documentation

OSB_LIB::UserGroup::UserGroup ( const Oid oid = Oid()  )  [explicit]

Constructor with optional object id.

OSB_LIB::UserGroup::UserGroup ( ModuleId  module  )  [explicit]

Constructor with the module of the group.


Member Function Documentation

const GrpAccessMap& OSB_LIB::UserGroup::accessMap (  )  const

Map of access rights.

const std::string& OSB_LIB::UserGroup::des (  )  const

Description for the group.

static void OSB_LIB::UserGroup::handleObjectStatus ( ObjectStatus  os,
const Oid id 
) [static, private]

Evalute the object status of a user group.

Parameters:
os Object status to evaluate.
id The id of the user group for which os is valid.
Exceptions:
ObjectDeleted 
ObjectModified 

void OSB_LIB::UserGroup::incObjVs ( const OSB_DB::Session session  )  [private]

Increment the object version by 1.

Parameters:
session Database session to use.
Exceptions:
OsbException (internal error) if the update of the object version in the database fails.
The function should be used only after a successful call of a lock() function.

void OSB_LIB::UserGroup::lock ( const OSB_DB::Session session  )  const [private]

Lock a user group in the database.

Parameters:
session Database session to use.
Exceptions:
OsbException from handleObjectStatus().

static void OSB_LIB::UserGroup::lock ( const OSB_DB::Session session,
const Oid id 
) [static, private]

Lock a user group in the database.

Parameters:
session Database session to use.
id The object id of the user group to lock.
Exceptions:
OsbException from handleObjectStatus(), (ObjectModified is not applicable).

const ModuleId OSB_LIB::UserGroup::module (  )  const

The OSB module of the group.

const std::string& OSB_LIB::UserGroup::name (  )  const

Name of the group.

const Oid OSB_LIB::UserGroup::oid (  )  const

The object id of the group.

void OSB_LIB::UserGroup::read ( const OSB_DB::Session session  ) 

Read the user group from the database.

Parameters:
session Database session to use.
Exceptions:
ObjectNotFound if the user group does not exist in the database.

void OSB_LIB::UserGroup::remove ( const OSB_DB::Session session  )  [private]

Remove the user group from the database.

Parameters:
session Database session to use.
Exceptions:
OsbException from incObjVs().
OsbException if user belong to the group.
Remove the group and all its access rights from the database.

void OSB_LIB::UserGroup::save ( const OSB_DB::Session session  )  [private]

Save name and description to the database.

Parameters:
session Database session to use.
Exceptions:
OsbException if another group with name() exists.
OsbException from lock(const OSB_DB::Session&) const, see there.

void OSB_LIB::UserGroup::setDes ( const std::string &  des  ) 

Set the description.

Parameters:
des Description for the group.
Exceptions:
OsbException if des is too long.

void OSB_LIB::UserGroup::setName ( const std::string &  name  ) 

Set the name.

Parameters:
name Name of the group.
Exceptions:
OsbException if name is empty.
OsbException if name is too long.


Friends And Related Function Documentation

friend class OSB_DB::UserGroupGw [friend]

Allow the gateway to set data members.

Definition at line 85 of file osbusrgrp.h.

friend class UserMgmtCfg [friend]

Allow to call database functions.

Definition at line 87 of file osbusrgrp.h.


Member Data Documentation

GrpAccessMap OSB_LIB::UserGroup::accessMap_ [private]

Map of access rights.

Definition at line 242 of file osbusrgrp.h.

std::string OSB_LIB::UserGroup::des_ [private]

Description of user group.

Definition at line 238 of file osbusrgrp.h.

ModuleId OSB_LIB::UserGroup::module_ [private]

The module of the group.

Definition at line 234 of file osbusrgrp.h.

std::string OSB_LIB::UserGroup::name_ [private]

Name of user group.

Definition at line 236 of file osbusrgrp.h.

long OSB_LIB::UserGroup::objVs_ [private]

Object version: set by the gateway during database operations.

Definition at line 240 of file osbusrgrp.h.

Oid OSB_LIB::UserGroup::oid_ [private]

The object id of the group.

Definition at line 232 of file osbusrgrp.h.


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