You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.6 KiB
C++

#ifndef PERMISSION_H
#define PERMISSION_H
#include "core-data.h"
#include "../core_global.h"
#include <QObject>
#include <QSharedPointer>
#include <QList>
#include <QWeakPointer>
#include <QDateTime>
class CORESHARED_EXPORT Permission : public QObject
{
Q_OBJECT
QX_REGISTER_FRIEND_CLASS(Permission)
Q_PROPERTY(QString pluginId READ pluginId WRITE setPluginId)
Q_PROPERTY(QString permissionName READ permissionName WRITE setPermissionName)
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 Permission(QObject *parent = nullptr);
long id() const;
void setId(long id);
QString pluginId() const;
void setPluginId(const QString &pluginId);
QString permissionName() const;
void setPermissionName(const QString &permissionName);
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<Role>> listRoles() const;
void setListRoles(const QList<QSharedPointer<Role>> &listRoles);
void addRole(QSharedPointer<Role> role);
private:
long m_id;
QString m_pluginId;
QString m_permissionName;
QDateTime m_lastModDate;
QDateTime m_createDate;
bool m_active;
QList<QSharedPointer<Role>> m_listRoles;
};
QX_REGISTER_HPP_CORE(Permission, QObject, 0)
#endif // PERMISSION_H