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 data:
- static const string pHashMagic; String-pointer (prefix) of the password into hash.
Public methods:
- bool access( const string &user, char mode, int owner, int groups, int access ); Check the access of the user in the mode to the resource with the owner, groups (separated ',') and permition access.
- void usrList( vector<string> &list ) const; 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 ) const; 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 ) const; Attaching of the user name.
- void grpList( vector<string> &list ) const; The list of the users' groups list.
- bool grpPresent( const string &name ) const; 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 ) const; 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( ); User name.
- string descr( ); User description.
- string longDescr( ); User long description.
- string picture( ); User image.
- string lang( ); User language, only into the dynamic translation text variables mode.
- bool sysItem( ); Sign of the system user.
- bool auth( const string &pass, string *hash = NULL ); Check the authenticity of the user by the password pass. The password hash, if it is supports, placing into the hash.
- string DB( ); User DB address.
- string tbl( ); Address of the table of user's DB.
- string fullDB( ); The full name of the table of user's DB.
- void setDescr( const string &vl ); Setting user's description to vl.
- void setLongDescr( const string &vl ); Setting user's long description to vl.
- void setPicture( const string &pct ); Setting user's image to pct.
- void setLang( const string &vl ); Setting user's language to vl.
- void setPass( const string &pass ); Setting user's password to pass.
- void setSysItem( bool vl ); Setting the sign of system user to vl.
- void setDB( const string &vl ); Setting user's DB address.
- TSeρurity &owner( ) const; "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( ); Users group name.
- string descr( ); Users group description.
- string longDescr( ); Users group long 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 setDescr( const string &vl ); Setting users group description to vl.
- void setLongDescr( const string &vl ); Setting users group long description 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( ) const; "Security" subsystem - the owner of the users' group.