Ananas Library 0.9.5
arole.h
1/****************************************************************************
2** $Id: arole.h,v 1.3 2006/08/23 08:24:50 app Exp $
3**
4** Role object header file of
5** Ananas application library
6**
7** Created : 20050527
8**
9** Copyright (C) 2003-2005 Grigory Panov, Yoshkar-Ola.
10**
11** This file is part of the Designer application of the Ananas
12** automation accounting system.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21**
22** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24**
25** Contact org@leaderit.ru if any conditions of this licensing are
26** not clear to you.
27**
28**********************************************************************/
29
30#ifndef AROLE_H
31#define AROLE_H
32
33#include "aobject.h"
34#include "adatabase.h"
35#include "acfg.h"
36//#include "auser.h"
37
38//class aUser;
39//class aPermission;
40//class aObject;
41
42
43
55class ANANAS_EXPORT aRole: public aObject
56{
57 Q_OBJECT
58public:
59
60 aRole();
61 aRole(Q_ULLONG roleId, aDatabase * adb);
62 aRole(aDatabase * adb);
63 virtual ERR_Code initObject();
64
65//public slots:
66
67 virtual ERR_Code New(const QString &name);
68
69 virtual ERR_Code Delete();
70 virtual ERR_Code Update();
71 virtual ERR_Code Select();
72 virtual ERR_Code Select(Q_ULLONG id);
73
74 virtual ERR_Code addPermission( aPermission );
75 virtual ERR_Code delPermission( aPermission );
76 virtual bool hasPermission( aPermission );
77
78 virtual ERR_Code addUser( Q_ULLONG userId );
79 virtual ERR_Code delUser( Q_ULLONG userId );
80
81// QValueList< aUser *> getUsers( bool assigned);
82
83 bool hasUser( Q_ULLONG userId);
84
85 virtual ERR_Code SetName( const QString & );
86 virtual QString GetName();
87
88 //virtual ERR_Code setLogin( const QString & );
89 //virtual ERR_Code setFirstName( const QString & );
90 //virtual ERR_Code setLastName( const QString & );
91
92//irtual Q_ULLONG getUserId( const QString &login, const QString &password );
93//irtual ERR_Code getRoles(QValueList<aRole> *lst);
94 bool First();
95 bool Next();
96 bool Last();
97 bool Prev();
98};
99
100
101#endif// AROLE_H
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject.
Определения adatabase.h:78
virtual bool First(const QString &tableName="")
Перемещает указатель на первую запись SQL таблицы.
Определения aobject.cpp:1065
virtual int New()
Add new object record in database.
Определения aobject.cpp:625
virtual bool Next(const QString &tableName="")
Перемещает указатель на следующую запись SQL таблицы.
Определения aobject.cpp:1040
virtual ERR_Code initObject()
Инициализирует объект при его создании.
Определения aobject.cpp:253
virtual int Delete()
Удаляет текущий объект из базы данных.
Определения aobject.cpp:692
virtual bool Prev(const QString &tableName="")
Перемещает указатель на предыдующую запись SQL таблицы.
Определения aobject.cpp:1052
aObject(QObject *parent=0, const char *name=0)
Конструктор для создания абстрактного объекта.
Определения aobject.cpp:62
virtual bool Last(const QString &tableName="")
Перемещает указатель на последнюю запись SQL таблицы.
Определения aobject.cpp:1078
virtual int Update()
Обновляет запись в базе данных текущеми значениями.
Определения aobject.cpp:718
virtual ERR_Code Select()
Определения arole.cpp:137
virtual ERR_Code addUser(Q_ULLONG userId)
Определения arole.cpp:279
bool hasUser(Q_ULLONG userId)
Определения arole.cpp:319
virtual QString GetName()
Определения arole.cpp:108
virtual ERR_Code delPermission(aPermission)
Определения arole.cpp:219
virtual bool hasPermission(aPermission)
Определения arole.cpp:249
virtual ERR_Code delUser(Q_ULLONG userId)
Определения arole.cpp:299
virtual ERR_Code addPermission(aPermission)
Определения arole.cpp:192
virtual ERR_Code SetName(const QString &)
Определения arole.cpp:91