2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * This class simply redirects the access requests to access control engine.
18 * The aim is to hide access control engine specific details from WRT modules.
19 * It also implements WRT_INTERFACE.h interfaces, so that ACE could access
20 * WRT specific and other information during the decision making.
22 * @file security_logic.h
23 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
24 * @author Ming Jin(ming79.jin@samsung.com)
25 * @brief Implementation file for security logic
27 #ifndef POLICY_ENFORCEMENT_POINT_H
28 #define POLICY_ENFORCEMENT_POINT_H
34 //#include <glib/gthread.h>
35 //#include <glib/gerror.h>
38 //#include <dpl/optional.h>
39 #include <dpl/event/inter_context_delegate.h>
40 #include <dpl/event/property.h>
42 #include <ace/AbstractPolicyEnforcementPoint.h>
43 #include <ace/PolicyResult.h>
47 class IResourceInformation;
48 class IOperationSystem;
49 class PolicyEvaluator;
50 class PolicyInformationPoint;
53 class PolicyEnforcementPoint : public AbstractPolicyEnforcementPoint
56 OptionalExtendedPolicyResult checkFromCache(Request &request);
57 ExtendedPolicyResult check(Request &request);
58 OptionalExtendedPolicyResult check(Request &request,
61 virtual ~PolicyEnforcementPoint();
66 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
67 DECLARE_EXCEPTION_TYPE(Base, AlreadyInitialized)
71 * This function take ownership of objects pass in call.
72 * Object will be deleted after call Deinitialize function.
74 void initialize(IWebRuntime *wrt,
75 IResourceInformation *resource,
76 IOperationSystem *operation);
79 void updatePolicy(const std::string &policy);
82 PolicyEvaluator *getPdp() const { return this->m_pdp; }
83 PolicyInformationPoint *getPip() const { return this->m_pip; }
86 PolicyEnforcementPoint();
87 friend class SecurityLogic;
88 private: // private data
90 IResourceInformation *m_res;
91 IOperationSystem *m_sys;
92 PolicyEvaluator *m_pdp;
93 PolicyInformationPoint *m_pip;
96 #endif // POLICY_ENFORCEMENT_POINT_H