File indexing completed on 2024-12-08 04:33:21
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 #include "libruqolacore_export.h" 0009 #include "permission.h" 0010 #include <QVector> 0011 class RoleInfo; 0012 class LIBRUQOLACORE_EXPORT Permissions 0013 { 0014 public: 0015 Permissions(); 0016 0017 [[nodiscard]] QVector<Permission> permissions() const; 0018 void setPermissions(const QVector<Permission> &permissions); 0019 0020 void parsePermissions(const QJsonObject &obj, const QString &str = {}, const QVector<RoleInfo> &roleInfo = {}); 0021 [[nodiscard]] bool isEmpty() const; 0022 0023 [[nodiscard]] int count() const; 0024 void clear(); 0025 0026 [[nodiscard]] Permission at(int index) const; 0027 0028 private: 0029 QVector<Permission> mPermissions; 0030 };