ImagingTools Core SDK
CLdapUserCollectionJoinerComp.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#include <imod/IModel.h>
8#include <imod/TSingleModelObserverBase.h>
9
10// ImtCore includes
11#include <imtbase/IObjectCollection.h>
12#include <imtbase/TModelUpdateBinder.h>
13
14
15namespace imtauth
16{
17
18
19class CLdapUserCollectionJoinerComp: public icomp::CComponentBase
20{
21public:
22 typedef icomp::CComponentBase BaseClass;
23
24 I_BEGIN_COMPONENT(CLdapUserCollectionJoinerComp);
25 I_ASSIGN(m_userCollectionCompPtr, "InternalUserCollection", "Internal user collection", true, "InternalUserCollection");
26 I_ASSIGN(m_ldapUserCollectionCompPtr, "LdapUserCollection", "LDAP user collection", true, "LdapUserCollection");
27 I_ASSIGN(m_ldapSystemIdAttrPtr, "LdapSystemId", "LDAP System-ID", false, "Ldap");
28 I_ASSIGN(m_ldapSystemNameAttrPtr, "LdapSystemName", "LDAP System Name", false, "LDAP");
29 I_END_COMPONENT;
30
31 CLdapUserCollectionJoinerComp();
32
33 QByteArray GetUserUuidByLogin(const QByteArray& login) const;
34 QByteArray GetLoginByUserUuid(const QByteArray& userUuid) const;
35 void OnUpdate(const istd::IChangeable::ChangeSet& changeSet, const imtbase::IObjectCollection* objectCollectionPtr);
36
37 // reimplemented (icomp::CComponentBase)
38 virtual void OnComponentCreated() override;
39 virtual void OnComponentDestroyed() override;
40
41protected:
42 I_REF(imtbase::IObjectCollection, m_userCollectionCompPtr);
43 I_REF(imtbase::IObjectCollection, m_ldapUserCollectionCompPtr);
44 I_ATTR(QByteArray, m_ldapSystemIdAttrPtr);
45 I_TEXTATTR(m_ldapSystemNameAttrPtr);
46
48 bool m_isBlocked;
49};
50
51
52} // namespace imtauth