Ananas Library 0.9.5
aRole Class Reference

#include <arole.h>

Inheritance diagram for aRole:
aObject

Public Member Functions

 aRole (Q_ULLONG roleId, aDatabase *adb)
 
 aRole (aDatabase *adb)
 
virtual ERR_Code initObject ()
 Init object after create.
 
virtual ERR_Code New (const QString &name)
 
virtual ERR_Code Delete ()
 
virtual ERR_Code Update ()
 Update curent selected object record to database.
 
virtual ERR_Code Select ()
 
virtual ERR_Code Select (Q_ULLONG id)
 
virtual ERR_Code addPermission (aPermission)
 
virtual ERR_Code delPermission (aPermission)
 
virtual bool hasPermission (aPermission)
 
virtual ERR_Code addUser (Q_ULLONG userId)
 
virtual ERR_Code delUser (Q_ULLONG userId)
 
bool hasUser (Q_ULLONG userId)
 
virtual ERR_Code SetName (const QString &)
 
virtual QString GetName ()
 
bool First ()
 
bool Next ()
 
bool Last ()
 
bool Prev ()
 
- Public Member Functions inherited from aObject
 aObject (QObject *parent=0, const char *name=0)
 
 aObject (const QString &oname, aDatabase *adb, QObject *parent=0, const char *name=0)
 
 aObject (aCfgItem context, aDatabase *adb, QObject *parent=0, const char *name=0)
 
virtual ~aObject ()
 Virtual destructor. .
 
virtual bool checkStructure ()
 Not implemented.
 
ERR_Code init ()
 Tune on metadata object and it's database tables.
 
ERR_Code decodeDocNum (QString nm, QString &pref, int &num)
 Осуществляет выделение символьного префикса из строки.
 
virtual ERR_Code select (Q_ULLONG id)
 
Q_ULLONG getUid ()
 Возвращает уникальный идентификатор объекта из базы данных.
 
bool selected (const QString &tablename="")
 Показывает задан ли текущий объект или запись в его табличной части.
 
ERR_Code select (const QString &query, const QString &tableName="")
 Осуществляет SQL запрос.
 
aDataTabletable (const QString &name="")
 Return the table of object by it's name.
 
virtual Q_ULLONG docId ()
 Returns document database id.
 
virtual bool Next (const QString &tableName="")
 Перемещает указатель на следующую запись SQL таблицы.
 
virtual bool Prev (const QString &tableName="")
 Перемещает указатель на предыдующую запись SQL таблицы.
 
virtual bool First (const QString &tableName="")
 Перемещает указатель на первую запись SQL таблицы.
 
virtual bool Last (const QString &tableName="")
 Перемещает указатель на последнюю запись SQL таблицы.
 
virtual int TableUpdate (const QString &tablename)
 
virtual QString displayString ()
 Возвращает строку, предназначенную для отображения пользователю объекта сложного типа.
 
virtual int LastErrorCode ()
 
virtual QString LastErrorMessage ()
 

Additional Inherited Members

- Public Slots inherited from aObject
virtual QString Uid ()
 
virtual bool IsSelected ()
 Checks if object selected.
 
virtual bool IsMarkDeleted (const QString &tname="")
 Checks "Deleted" marker.
 
virtual bool IsMarked ()
 Checks "Marked" marker.
 
virtual int SetMarkDeleted (bool Deleted, const QString &tablename="")
 Устанавливает признак логического удаления объекта (записи SQL таблицы)
 
virtual int SetMarked (bool Marked)
 Выставляет отметку на объекте.
 
virtual int New ()
 Add new object record in database.
 
virtual int Copy ()
 
virtual int Conduct ()
 
virtual int UnConduct ()
 
virtual bool IsConducted ()
 
virtual QString Kind (const QString &name=QString::null)
 
virtual QVariant Value (const QString &name, const QString &tableName="")
 Return field value of the primary object database table.
 
virtual int SetValue (const QString &name, const QVariant &value, const QString &tableName="")
 Set field value of the primary object database table.
 
virtual QVariant sysValue (const QString &name, const QString &tableName="")
 Gets system field value.
 
virtual int setSysValue (const QString &name, QVariant value, const QString &tableName="")
 Sets system field value.
 
virtual int SetFilter (const QString &valname, const QVariant &value)
 Задает фильтр записей/объектов
 
virtual int ClearFilter ()
 Чистит фильтр записей/объектов.
 
virtual int TableSetFilter (const QString &tname, const QString &valname, const QVariant &value)
 Устанавливает вильтр записей табличной части объекта.
 
virtual int TableClearFilter (const QString &tname)
 Чистит фильтр записей указанной табличной части объекта.
 
virtual bool IsFiltred ()
 Показывает наличие активного фильтра
 
- Public Attributes inherited from aObject
aCfgmd
 
aCfgItem obj
 
aDatabasedb
 
- Protected Member Functions inherited from aObject
virtual aCfgItem displayStringContext ()
 Возвращает контекст (узел дерева) метаданных для вычисления строкового представления сложного типа.
 
virtual ERR_Code setObject (aCfgItem newobject)
 Sets new object type after create.
 
bool isInited ()
 
void setInited (bool flag)
 
ERR_Code tableInsert (const QString &dbname, aCfgItem obj, const QString &name="")
 Insert table name and its link into internal buffer.
 
ERR_Code tableInsert (const QString &dbname, const QString &name="")
 Insert table name and its link into internal buffer.
 
ERR_Code tableRemove (const QString &name="")
 Remove table from buffer.
 
virtual QVariant tValue (const QString &tablename, const QString &name)
 Return field value of the secondary object database table.
 
virtual ERR_Code setTValue (const QString &tablename, const QString &name, const QVariant &value)
 Set field value of the secondary object database table.
 
virtual QString trSysName (const QString &sname)
 Not implemented.
 
void setSelected (bool sel, const QString &tablename="")
 Явно задает состояние выбранности объекта или записи его табличной части.
 
virtual ERR_Code setTFilter (const QString &tname, const QString &valname, const QVariant &value)
 Устанавливает вильтр записей табличной части объекта.
 
virtual ERR_Code clearTFilter (const QString &tname)
 Чистит фильтр записей указанной табличной части объекта.
 
void setLastError (int, QString)
 Задает значения свойствам lastErrorCode и lastErrorMessage класса
 
- Protected Attributes inherited from aObject
bool concrete
 

Detailed Description

\if english
Not visual object used for working with catalogues in database.
Used as interface between database and script or wObjects*
\endif

Constructor & Destructor Documentation

◆ aRole() [1/2]

aRole::aRole ( Q_ULLONG roleId,
aDatabase * adb )

Constructor.

References initObject(), and Select().

◆ aRole() [2/2]

aRole::aRole ( aDatabase * adb)

Constructor.

References initObject().

Member Function Documentation

◆ addPermission()

ERR_Code aRole::addPermission ( aPermission p)
virtual

Adds permission to role

Parameters
p- permission
Returns
error code

References aObject::setSelected(), and aObject::table().

◆ addUser()

ERR_Code aRole::addUser ( Q_ULLONG userId)
virtual

Adds user to role

Parameters
userId- user id
Returns
error code

References aUser::addRole(), and aObject::sysValue().

◆ Delete()

ERR_Code aRole::Delete ( )
virtual

Delete this role.

Reimplemented from aObject.

References aObject::setSelected(), and aObject::table().

◆ delPermission()

ERR_Code aRole::delPermission ( aPermission p)
virtual

Removs permission from role

Parameters
p- permission
Returns
error code

◆ delUser()

ERR_Code aRole::delUser ( Q_ULLONG userId)
virtual

Delete user from role

Parameters
userId- user id
Returns
error code

References aUser::delRole(), and aObject::sysValue().

◆ GetName()

QString aRole::GetName ( )
virtual

Gets role name.

Returns
role name

References aObject::sysValue().

◆ hasPermission()

bool aRole::hasPermission ( aPermission p)
virtual

Check permission p.

Parameters
p- permission
Returns
true, if role has perission

References aObject::sysValue(), and aObject::table().

◆ hasUser()

bool aRole::hasUser ( Q_ULLONG userId)

Check user have role.

Parameters
userId- user id
Returns
true, if role has user

References aUser::hasRole(), and aObject::sysValue().

◆ initObject()

ERR_Code aRole::initObject ( )
virtual

Init object after create.

Need setObject( id ), where id - if of the metadata object of the adb->cfg loaded Configuration.

Returns
error code

Reimplemented from aObject.

References aObject::initObject(), and aObject::tableInsert().

Referenced by aRole(), and aRole().

◆ New()

ERR_Code aRole::New ( const QString & rname)
virtual

Adds new pole.

References aObject::setSelected(), and aObject::table().

◆ Select() [1/2]

ERR_Code aRole::Select ( )
virtual


Sets primary table selected.

Returns
error code

References aObject::setSelected(), and aObject::table().

Referenced by aRole(), and aUser::getRoles().

◆ Select() [2/2]

ERR_Code aRole::Select ( Q_ULLONG id)
virtual

Select role.

Parameters
id- role id
Returns
error code

References aObject::setSelected(), and aObject::table().

◆ SetName()

ERR_Code aRole::SetName ( const QString & rname)
virtual

Sets role name.

Parameters
rname- role name
Returns
error code

References aObject::setSysValue().

◆ Update()

ERR_Code aRole::Update ( )
virtual

Update curent selected object record to database.

Returns
error code

Reimplemented from aObject.

References aObject::TableUpdate(), and aObject::Update().


The documentation for this class was generated from the following files: