File indexing completed on 2024-12-01 04:35:44

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QDebug>
0011 class LIBRUQOLACORE_EXPORT RoleInfo
0012 {
0013 public:
0014     RoleInfo();
0015     ~RoleInfo() = default;
0016 
0017     [[nodiscard]] const QString &identifier() const;
0018     void setIdentifier(const QString &newIdentifier);
0019 
0020     [[nodiscard]] const QString &scope() const;
0021     void setScope(const QString &newScope);
0022 
0023     void parseRoleInfo(const QJsonObject &obj);
0024 
0025     [[nodiscard]] const QString &name() const;
0026     void setName(const QString &newName);
0027 
0028     [[nodiscard]] const QString &description() const;
0029     void setDescription(const QString &newDescription);
0030 
0031     [[nodiscard]] bool roleProtected() const;
0032     void setRoleProtected(bool newRoleProtected);
0033 
0034     [[nodiscard]] bool mandatory2fa() const;
0035     void setMandatory2fa(bool newMandatory2fa);
0036 
0037     [[nodiscard]] bool operator==(const RoleInfo &other) const;
0038 
0039 private:
0040     QString mName;
0041     QString mIdentifier;
0042     QString mScope;
0043     QString mDescription;
0044     bool mRoleProtected = false;
0045     bool mMandatory2fa = false;
0046 };
0047 
0048 Q_DECLARE_METATYPE(RoleInfo)
0049 Q_DECLARE_TYPEINFO(RoleInfo, Q_RELOCATABLE_TYPE);
0050 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const RoleInfo &t);