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_controller.cpp
23 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
24 * @author Ming Jin(ming79.jin@samsung.com)
26 * @brief Implementation file for security controller
28 #include <security_controller.h>
30 #include <dpl/ace/PolicyEnforcementPoint.h>
31 #include <dpl/ace/WRT_INTERFACE.h>
32 #include <dpl/ace/PolicyEvaluatorFactory.h>
33 #include <dpl/singleton_impl.h>
34 #include <dpl/log/log.h>
36 #include <attribute_facade.h>
37 #include <security_logic.h>
39 IMPLEMENT_SINGLETON(SecurityController)
41 struct SecurityController::Impl
46 SecurityController::SecurityController()
48 m_impl.Reset(new Impl);
51 SecurityController::~SecurityController()
55 void SecurityController::OnEventReceived(
56 const SecurityControllerEvents::InitializeSyncEvent & /* event */)
58 m_impl->logic.initialize();
61 void SecurityController::OnEventReceived(
62 const SecurityControllerEvents::TerminateSyncEvent & /*event*/)
64 m_impl->logic.terminate();
67 void SecurityController::OnEventReceived(
68 const SecurityControllerEvents::AuthorizeWidgetInstallEvent &event)
70 m_impl->logic.authorizeWidgetInstall(event.GetArg0(), event.GetArg1());
73 void SecurityController::OnEventReceived(
74 const SecurityControllerEvents::CheckFunctionCallSyncEvent &ev)
76 *ev.GetArg0() = m_impl->logic.checkFunctionCall(ev.GetArg1());
79 void SecurityController::OnEventReceived(
80 const SecurityControllerEvents::SetWidgetPreferenceEvent & /*event*/)
82 // m_impl->logic.setWidgetPreference(event.GetArg0(),
87 void SecurityController::OnEventReceived(
88 const SecurityControllerEvents::SetResourcePreferenceEvent & /*event*/)
90 // m_impl->logic.setResourcePreference(event.GetArg0(), event.GetArg1());
93 void SecurityController::OnEventReceived(
94 const SecurityControllerEvents::GetWidgetsPreferencesSyncEvent & /*event*/)
96 // *event.GetArg0() = m_impl->logic.getWidgetsPreferences();
99 void SecurityController::OnEventReceived(
100 const SecurityControllerEvents::GetResourcesPreferencesSyncEvent & /*event*/)
102 // *event.GetArg0() = m_impl->logic.getResourcesPreferences();
105 void SecurityController::OnEventReceived(
106 const SecurityControllerEvents::ResetWidgetsPreferencesEvent & /*evt*/)
108 // m_impl->logic.resetWidgetsPreferences();
111 void SecurityController::OnEventReceived(
112 const SecurityControllerEvents::ResetResourcesPreferencesEvent & /*evt*/)
114 // m_impl->logic.resetResourcesPreferences();