26#include <qabstractitemmodel.h>
35 userRoleDeveloper = 1,
36 userRoleAdministrator = 2,
44 featFileSystem = 0x02,
45 featUserManagement = 0x04,
47 featConsoleRead = 0x10,
48 featConsoleReadWrite = 0x20,
62 UserFeatures sfeatures, QByteArray &spassword,
bool sStandardUser)
63 : name(sname), id(suid), iniFile(siniFile), role(srole), password(spassword),
64 features(sfeatures), standardUser(sStandardUser) {}
70 UserFeatures features;
98 QString getRoleName(
const UserRole &role)
const;
99 QString getFeatureName(
const UserFeature &feature)
const;
101 QVariant
data(
const QModelIndex &
index,
int role)
const;
102 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
103 QModelIndex
index(
int row,
int column,
const QModelIndex &
parent = QModelIndex())
const;
104 QModelIndex
parent(
const QModelIndex &
index)
const;
109 void removeAllUsers();
110 bool removeUser(
const QModelIndex &
index);
112 QModelIndex getUser(
const QString &userId)
const;
113 bool hasPassword(
const QModelIndex &
index)
const;
114 bool checkPassword(
const QModelIndex &
index,
const QString &password)
const;
115 QString getUserName(
const QModelIndex &
index)
const;
116 QString getUserId(
const QModelIndex &
index)
const;
118 UserFeatures getUserFeatures(
const QModelIndex &
index)
const;
119 QString getUserSettingsFile(
const QModelIndex &
index)
const;
121 bool setCurrentUser(
const QString &userId);
132Q_DECLARE_METATYPE(ito::UserFeatures);
class for for visualizing the available users
Definition UserModel.h:81
UserModel()
Definition UserModel.cpp:35
QModelIndex parent(const QModelIndex &index) const
Definition UserModel.cpp:60
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition UserModel.cpp:79
~UserModel()
Definition UserModel.cpp:47
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition UserModel.cpp:180
QList< UserInfoStruct > m_userInfo
list with user information
Definition UserModel.h:126
int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition UserModel.cpp:165
QModelIndex m_currentUser
the model index of the currently logged-in user
Definition UserModel.h:127
QList< QVariant > m_alignment
list of alignments for the corresponding headers
Definition UserModel.h:125
QVariant data(const QModelIndex &index, int role) const
Definition UserModel.cpp:102
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition UserModel.cpp:70
int addUser(const UserInfoStruct &newUser)
Definition UserModel.cpp:197
QList< QString > m_headers
string list of names of column headers
Definition UserModel.h:124
Definition apiFunctionsGraph.cpp:40
UserFeature
Enumeration that defines some feature permissions for a user.
Definition UserModel.h:42
UserRole
Enumeration that defines some user roles.
Definition UserModel.h:33
Definition UserModel.h:59