PLCnext API Documentation 25.0.2.69
RscServiceSecurityStubBase.hxx
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Rsc/Commons/Services/IRscAuthorizator.hpp"
9#include "Arp/Base/Rsc/Commons/Services/RscServiceAuthorizator.hpp"
10
11namespace Arp::Base::Rsc::Commons::Services
12{
13
25template<class T>
27{
28protected: // usings
29 using ServiceImplType = T;
30
31public: // construction
32 RscServiceSecurityStubBase(const char* serviceProviderName, IRscAuthorizator* pAuthorizator);
33
34protected: // operations
35 void AuthorizeServiceInvocation(const char* operationName);
36
37private: // fields
38 RscServiceAuthorizator authorizator;
39};
40
42// inline methods of class RscServiceSecurityStubBase
43
48template<class T>
49inline RscServiceSecurityStubBase<T>::RscServiceSecurityStubBase(const char* serviceProviderName, IRscAuthorizator* pAuthorizator)
50 : authorizator(serviceProviderName, ServiceImplType::GetProxyFactory().GetServiceName(), *pAuthorizator)
51{
52}
53
58template<class T>
60{
61 this->authorizator.AuthorizeServiceInvocation(operationName);
62}
63
64} // end of namespace Arp::Base::Rsc::Commons::Services
This interface is used to authorize a Rsc service call.
Definition: IRscAuthorizator.hpp:21
This class is used to authorize RSC service calls according security rules.
Definition: RscServiceAuthorizator.hpp:18
Base class for RSC service security stubs.
Definition: RscServiceSecurityStubBase.hxx:27
T ServiceImplType
The type of the service implementation (e.g. DemoServiceImpl)
Definition: RscServiceSecurityStubBase.hxx:29
RscServiceSecurityStubBase(const char *serviceProviderName, IRscAuthorizator *pAuthorizator)
Constructs a RscServiceSecurityStubBase instance.
Definition: RscServiceSecurityStubBase.hxx:49
void AuthorizeServiceInvocation(const char *operationName)
This operation is used to authorize any method call of the service implementation.
Definition: RscServiceSecurityStubBase.hxx:59