ImagingTools Core SDK
CCommandPermissionsProviderJoinerComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <ilog/TLoggerCompWrap.h>
7#include <icomp/CComponentBase.h>
8
9// ImtCore includes
10#include <imtserverapp/ICommandPermissionsProvider.h>
11
12
13namespace imtserverapp
14{
15
16
17class CCommandPermissionsProviderJoinerComp:
18 public icomp::CComponentBase,
20{
21public:
22 typedef icomp::CComponentBase BaseClass;
23
24 I_BEGIN_COMPONENT(CCommandPermissionsProviderJoinerComp);
26 I_ASSIGN_MULTI_0(m_commandPermissionsProviderCompPtr, "CommandPermissionsProvider", "List of command permission providers", false);
27 I_END_COMPONENT;
28
29 // reimplemented (imtserverapp::ICommandPermissionsProvider)
30 virtual LogicalCheckMode GetCommandPermissionCheckMode() const override;
31 virtual QByteArrayList GetCommandIds() const override;
32 virtual QByteArrayList GetCommandPermissions(const QByteArray& commandId) const override;
33
34protected:
35 // reimplemented (icomp::CComponentBase)
36 virtual void OnComponentCreated() override;
37
38private:
39 void UpdatePermissionsCache();
40
41protected:
42 I_MULTIREF(imtserverapp::ICommandPermissionsProvider, m_commandPermissionsProviderCompPtr);
43
44private:
45 QMap<QByteArray, QByteArrayList> m_permissionsCache;
46};
47
48
49} // namespace imtbase
50
51