00001 /**************************************************************************** 00002 ** $Id: arole.h,v 1.3 2006/08/23 08:24:50 app Exp $ 00003 ** 00004 ** Role object header file of 00005 ** Ananas application library 00006 ** 00007 ** Created : 20050527 00008 ** 00009 ** Copyright (C) 2003-2005 Grigory Panov, Yoshkar-Ola. 00010 ** 00011 ** This file is part of the Designer application of the Ananas 00012 ** automation accounting system. 00013 ** 00014 ** This file may be distributed and/or modified under the terms of the 00015 ** GNU General Public License version 2 as published by the Free Software 00016 ** Foundation and appearing in the file LICENSE.GPL included in the 00017 ** packaging of this file. 00018 ** 00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00021 ** 00022 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru 00023 ** See http://www.leaderit.ru/gpl/ for GPL licensing information. 00024 ** 00025 ** Contact org@leaderit.ru if any conditions of this licensing are 00026 ** not clear to you. 00027 ** 00028 **********************************************************************/ 00029 00030 #ifndef AROLE_H 00031 #define AROLE_H 00032 00033 #include "aobject.h" 00034 #include "adatabase.h" 00035 #include "acfg.h" 00036 //#include "auser.h" 00037 00038 //class aUser; 00039 //class aPermission; 00040 //class aObject; 00041 00042 00043 00055 class ANANAS_EXPORT aRole: public aObject 00056 { 00057 Q_OBJECT 00058 public: 00059 00060 aRole(); 00061 aRole(Q_ULLONG roleId, aDatabase * adb); 00062 aRole(aDatabase * adb); 00063 virtual ERR_Code initObject(); 00064 00065 //public slots: 00066 00067 virtual ERR_Code New(const QString &name); 00068 00069 virtual ERR_Code Delete(); 00070 virtual ERR_Code Update(); 00071 virtual ERR_Code Select(); 00072 virtual ERR_Code Select(Q_ULLONG id); 00073 00074 virtual ERR_Code addPermission( aPermission ); 00075 virtual ERR_Code delPermission( aPermission ); 00076 virtual bool hasPermission( aPermission ); 00077 00078 virtual ERR_Code addUser( Q_ULLONG userId ); 00079 virtual ERR_Code delUser( Q_ULLONG userId ); 00080 00081 // QValueList< aUser *> getUsers( bool assigned); 00082 00083 bool hasUser( Q_ULLONG userId); 00084 00085 virtual ERR_Code SetName( const QString & ); 00086 virtual QString GetName(); 00087 00088 //virtual ERR_Code setLogin( const QString & ); 00089 //virtual ERR_Code setFirstName( const QString & ); 00090 //virtual ERR_Code setLastName( const QString & ); 00091 00092 //irtual Q_ULLONG getUserId( const QString &login, const QString &password ); 00093 //irtual ERR_Code getRoles(QValueList<aRole> *lst); 00094 bool First(); 00095 bool Next(); 00096 bool Last(); 00097 bool Prev(); 00098 }; 00099 00100 00101 #endif// AROLE_H