20#ifndef ORES_QT_ACCOUNT_ROLES_WIDGET_HPP
21#define ORES_QT_ACCOUNT_ROLES_WIDGET_HPP
29#include <boost/uuid/uuid.hpp>
30#include "ores.qt/ClientManager.hpp"
31#include "ores.logging/make_logger.hpp"
32#include "ores.iam/domain/role.hpp"
46 inline static std::string_view logger_name =
47 "ores.qt.account_roles_widget";
49 [[nodiscard]]
static auto& lg() {
51 static auto instance = make_logger(logger_name);
85 void statusMessage(
const QString& message);
86 void errorMessage(
const QString& message);
90 void onAssignRoleClicked();
91 void onRevokeRoleClicked();
92 void onRoleSelectionChanged();
95 void updateButtonStates();
96 void refreshRolesList();
106 void executeRoleOperation(
107 std::function<std::pair<bool, std::string>()> requestFunc,
108 const std::string& roleName,
109 const QString& successMessage,
110 const QString& errorTitle);
113 QGroupBox* groupBox_;
114 QListWidget* rolesList_;
115 QToolButton* assignButton_;
116 QToolButton* revokeButton_;
119 boost::uuids::uuid accountId_;
120 std::vector<iam::domain::role> assignedRoles_;
121 std::vector<iam::domain::role> allRoles_;
122 bool isReadOnly_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Widget for managing roles assigned to an account.
Definition AccountRolesWidget.hpp:42
void loadRoles()
Loads the roles for the current account.
Definition AccountRolesWidget.cpp:95
void setClientManager(ClientManager *clientManager)
Sets the client manager for making requests.
Definition AccountRolesWidget.cpp:87
std::vector< boost::uuids::uuid > getAssignedRoleIds() const
Gets the currently assigned role IDs.
Definition AccountRolesWidget.cpp:184
void setAccountId(const boost::uuids::uuid &accountId)
Sets the account ID to manage roles for.
Definition AccountRolesWidget.cpp:91
void setReadOnly(bool readOnly)
Sets the widget to read-only mode.
Definition AccountRolesWidget.cpp:179
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90