10. Subsystem Security (TSeρurity)
Security subsystem is presented by an object TSesurity, which contains group objects of TGroup and users TUser.
User object TUser contains user information and checks the authenticity of the user in accordance with the specified password.
TGroup user object contains information about the group of users and checks the user's belonging to the group.
10.1. The object of the "Security" subsystem. (TSeρurity)
Public methods:
- bool access( const string &user, char mode, int owner, int group, int access ); Check the access of the user <user> with the mode rights <mode> to the resource with the owner <owner> and group <access>.
- void usrList( vector<string> &list ); The list of the users <list>.
- void usrGrpList( const string &name, vector<string> &list ); The list of the users' groups <list>, in which the user <name> is included.
- bool usrPresent( const string &name ); Check fro the presence of the specified user <name>.
- int usrAdd( const string &name, const string &db = "*.*" ); Addition of the user <name> with the saving to the DB <db>.
- void usrDel( const string &name, bool complete = false ); Deleting of the user <name> with the possibility of the completely deleting <complete>.
- AutoHD<TUser> usrAt( const string &name ); Attaching of the user <name>.
- void grpList( vector<string> &list ); The list of the users' groups <list>.
- bool grpPresent( const string &name ); Check fro the presence of the specified users' group <name>.
- int grpAdd( const string &name, const string &db = "*.*" ); Addition of the users' group <name> with the saving to the DB <db>.
- void grpDel( const string &name, bool complete = false ); Deleting of the users' group <name> with the possibility of the completely deleting <complete>.
- AutoHD<TGroup> grpAt( const string &name ); Connection to the users' group <name>.
10.2. The user's object (TUser)
Inherits: | TCntrNode, TConfig. |
Public methods:
- TUser( const string &name, const string &db, TElem *el ); Initializing constructor.
- string name( ); The user's name.
- string lName( ); The full user's name.
- string descr( ); The user's description.
- string picture( ); The user's image.
- bool sysItem( ); The sign of the system user.
- bool auth( const string &pass ); Check the authenticity of the user by the password <pass>.
- string DB( ); User's DB address.
- string tbl( ); Address of the table of the user's DB.
- string fullDB( ); The full name of the table of the user's DB.
- void setLName( const string &nm ); Setting of the full user's name to <nm>.
- void setPicture( const string &pct ); Setting the user's image to <pct>.
- void setPass( const string &pass ); Setting the user's password to <pass>.
- void setSysItem( bool vl ); Setting the sign of the system user to <vl>.
- void setDB( const string &vl ); Setting the user's DB address.
- TSeρurity &owner( ); "Security" subsystem - the owner of the user.
10.3. The users' group object (TGroup)
Inherits: | TCntrNode, TConfig. |
Public methods:
- TGroup( const string &name, const string &db, TElem *el ); Initializing constructor.
- string name( ); The users' group name.
- string lName( ); The full users' group name.
- string descr( ); The group's description.
- bool sysItem( ); The sign of the system user.
- string DB( ); Users' group DB address.
- string tbl( ); Address of the table of the users' group DB.
- string fullDB( ); The full name of the table of the users' group DB.
- void setLName( const string &nm ); Setting of the full users' group name to <nm>.
- void setSysItem( bool vl ); Setting the sign of the system user to <vl>.
- void setDB( const string &vl ); Setting the users' group DB address.
- bool user( const string &name ); Check for the user's belonging to the group <name>.
- void userAdd( const string &name ); Addition of the user <name> to the group.
- void userDel( const string &name ); Deleting of the user <name> from the group.
- TSeρurity &owner( ); "Security" subsystem - the owner of the users' group.