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 #ifdef DBUS_CONNECTION
39 #include <dpl/event/inter_context_delegate.h>
40 #include <dpl/event/property.h>
43 #include <ace/AbstractPolicyEnforcementPoint.h>
44 #include <ace/PolicyResult.h>
48 class IResourceInformation;
49 class IOperationSystem;
50 class PolicyEvaluator;
51 class PolicyInformationPoint;
54 class PolicyEnforcementPoint : public AbstractPolicyEnforcementPoint
57 OptionalExtendedPolicyResult checkFromCache(Request &request);
58 ExtendedPolicyResult check(Request &request);
59 OptionalExtendedPolicyResult check(Request &request,
62 virtual ~PolicyEnforcementPoint();
67 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
68 DECLARE_EXCEPTION_TYPE(Base, AlreadyInitialized)
72 * This function take ownership of objects pass in call.
73 * Object will be deleted after call Deinitialize function.
75 void initialize(IWebRuntime *wrt,
76 IResourceInformation *resource,
77 IOperationSystem *operation);
80 void updatePolicy(const std::string &policy);
83 PolicyEvaluator *getPdp() const { return this->m_pdp; }
84 PolicyInformationPoint *getPip() const { return this->m_pip; }
87 PolicyEnforcementPoint();
88 friend class SecurityLogic;
89 private: // private data
91 IResourceInformation *m_res;
92 IOperationSystem *m_sys;
93 PolicyEvaluator *m_pdp;
94 PolicyInformationPoint *m_pip;
97 #endif // POLICY_ENFORCEMENT_POINT_H