ImagingTools Core SDK
CRoleCollectionAdapterComp.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 <icomp/CComponentBase.h>
7
8// ImtCore includes
9#include <imtbase/IObjectCollection.h>
10#include <imtauth/IRoleInfoProvider.h>
11
12
13namespace imtauth
14{
15
16
17class CRoleCollectionAdapterComp:
18 public icomp::CComponentBase,
19 virtual public IRoleInfoProvider
20{
21public:
22 typedef icomp::CComponentBase BaseClass;
23
24 I_BEGIN_COMPONENT(CRoleCollectionAdapterComp);
25 I_REGISTER_INTERFACE(IRoleInfoProvider);
26 I_ASSIGN(m_roleCollectionCompPtr, "RoleCollection", "Adapting the collection to the provider", true, "RoleCollection");
27 I_END_COMPONENT;
28
29 // reimplemented (IRoleInfoProvider)
30 virtual const imtbase::ICollectionInfo& GetRoleList() const override;
31 virtual imtauth::IRoleUniquePtr GetRole(const QByteArray& objectId, const iprm::IParamsSet* paramsPtr = nullptr) const override;
32
33protected:
34 I_REF(imtbase::IObjectCollection, m_roleCollectionCompPtr);
35};
36
37
38} // namespace imtauth
39
40