ICF 3.1.1.10
Technical documentation of ICF Libraries
CStaticRightsProviderComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QByteArray>
11#include <QtCore/QSet>
12
13// ICF includes
16
17
18namespace iauth
19{
20
21
24 public IRightsProvider
25{
26public:
28
29 I_BEGIN_COMPONENT(CStaticRightsProviderComp);
30 I_REGISTER_INTERFACE(IRightsProvider);
31 I_ASSIGN(m_slaveProviderIfPtr, "SlaveProvider", "Slave rights provider", false, "SlaveProvider");
32 I_ASSIGN(m_defaultRightAttrPtr, "DefaultRight", "Default rights enabled", false, false);
33 I_ASSIGN_MULTI_0(m_rightsOnAttrPtr, "RightsOn", "List of enabled rights", false);
34 I_ASSIGN_MULTI_0(m_rightsOffAttrPtr, "RightsOff", "List of disabled rights", false);
35 I_END_COMPONENT;
36
37 // reimplemented (iauth::IRightsProvider)
38 virtual bool HasRight(
39 const QByteArray& operationId,
40 bool beQuiet = false) const override;
41
42protected:
43 // reimplemented (icomp::CComponentBase)
44 void OnComponentCreated() override;
45
46private:
47 I_REF(IRightsProvider, m_slaveProviderIfPtr);
48 I_ATTR(bool, m_defaultRightAttrPtr);
49 I_MULTIATTR(QString, m_rightsOnAttrPtr);
50 I_MULTIATTR(QString, m_rightsOffAttrPtr);
51
52 typedef QSet<QByteArray> RightsList;
53
54 RightsList m_rightsOn;
55 RightsList m_rightsOff;
56};
57
58
59} // namespace iauth
60
61
virtual bool HasRight(const QByteArray &operationId, bool beQuiet=false) const override
Checks if user has rights for specific operation.
Base class for component implementation.
Contains implementations of interfaces and components related to right management.

© Witold Gantzke and Kirill Lepskiy