|
|
|
#ifndef ROLE_H
|
|
|
|
#define ROLE_H
|
|
|
|
|
|
|
|
#include "core-data.h"
|
|
|
|
#include "../core_global.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSharedPointer>
|
|
|
|
#include <QList>
|
|
|
|
#include <QWeakPointer>
|
|
|
|
#include <QDateTime>
|
|
|
|
|
|
|
|
class CORESHARED_EXPORT Role : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
QX_REGISTER_FRIEND_CLASS(Role)
|
|
|
|
Q_PROPERTY(QString name READ name WRITE setName)
|
|
|
|
Q_PROPERTY(QDateTime lastModDate READ lastModDate WRITE setLastModDate)
|
|
|
|
Q_PROPERTY(QDateTime createDate READ createDate WRITE setCreateDate)
|
|
|
|
Q_PROPERTY(bool active READ active WRITE setActive)
|
|
|
|
public:
|
|
|
|
explicit Role(QObject *parent = 0);
|
|
|
|
|
|
|
|
long id() const;
|
|
|
|
void setId(long id);
|
|
|
|
|
|
|
|
QString name() const;
|
|
|
|
void setName(const QString &name);
|
|
|
|
|
|
|
|
QDateTime lastModDate() const;
|
|
|
|
void setLastModDate(const QDateTime &lastModDate);
|
|
|
|
|
|
|
|
QDateTime createDate() const;
|
|
|
|
void setCreateDate(const QDateTime &createDate);
|
|
|
|
|
|
|
|
bool active() const;
|
|
|
|
void setActive(bool active);
|
|
|
|
|
|
|
|
QList<QSharedPointer<User> > listUsers() const;
|
|
|
|
void setListUsers(const QList<QSharedPointer<User> > &listUsers);
|
|
|
|
|
|
|
|
QList<QSharedPointer<Permission> > listPermissions() const;
|
|
|
|
void setListPermissions(const QList<QSharedPointer<Permission> > &listPermissions);
|
|
|
|
|
|
|
|
void addPermission(QSharedPointer<Permission> perm);
|
|
|
|
void clearPermissions();
|
|
|
|
|
|
|
|
private:
|
|
|
|
long m_id;
|
|
|
|
QString m_name;
|
|
|
|
QDateTime m_lastModDate;
|
|
|
|
QDateTime m_createDate;
|
|
|
|
bool m_active;
|
|
|
|
QList<QSharedPointer<User> > m_listUsers;
|
|
|
|
QList<QSharedPointer<Permission> > m_listPermissions;
|
|
|
|
};
|
|
|
|
|
|
|
|
QX_REGISTER_HPP_CORE(Role, QObject, 0)
|
|
|
|
|
|
|
|
#endif // ROLE_H
|