user.h 647 B

12345678910111213141516171819202122232425262728
  1. #ifndef USER_H
  2. #define USER_H
  3. #include <QString>
  4. #include <QVector>
  5. class User {
  6. public:
  7. User();
  8. User(const QString& username, const QString& password);
  9. QString getUsername() const;
  10. void setUsername(const QString& username);
  11. QString getPassword() const;
  12. void setPassword(const QString& password);
  13. QVector<QString> getRoles() const;
  14. void setRoles(const QVector<QString>& roles);
  15. void addRole(const QString& role);
  16. void removeRole(const QString& role);
  17. bool hasRole(const QString& role) const;
  18. private:
  19. QString m_username;
  20. QString m_password;
  21. QVector<QString> m_roles;
  22. };
  23. #endif // USER_H