ImagingTools Core SDK
CUserChangeGeneratorComp.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// ImtCore includes
6#include <imtbase/CDocumentChangeGeneratorCompBase.h>
7
8
9namespace imtauth
10{
11
12
13class CUserChangeGeneratorComp: public imtbase::CDocumentChangeGeneratorCompBase
14{
15public:
16 typedef imtbase::CDocumentChangeGeneratorCompBase BaseClass;
17
18 I_BEGIN_COMPONENT(CUserChangeGeneratorComp);
19 I_ASSIGN(m_roleCollectionCompPtr, "RoleCollection", "Role collection", true, "RoleCollection");
20 I_ASSIGN(m_userGroupCollectionCompPtr, "UserGroupCollection", "User group collection", true, "UserGroupCollection");
21 I_END_COMPONENT;
22
23protected:
24 QString GetRoleName(const QByteArray& roleId) const;
25 QString GetGroupName(const QByteArray& groupId) const;
26
27 // reimplemented (imtbase::CDocumentChangeGeneratorCompBase)
28 virtual bool CompareDocuments(
29 const istd::IChangeable& oldDocument,
30 const istd::IChangeable& newDocument,
31 imtbase::CObjectCollection& documentChangeCollection,
32 QString& errorMessage) override;
33 virtual QString CreateCustomOperationDescription(const imtbase::COperationDescription& operationDescription, const QByteArray& languageId = QByteArray()) const override;
34
35protected:
36 I_REF(imtbase::IObjectCollection, m_roleCollectionCompPtr);
37 I_REF(imtbase::IObjectCollection, m_userGroupCollectionCompPtr);
38};
39
40
41} // namespace imtauth
42
43