From 1e46c217538426c19e6697ab6a32a2c4804d9c1b Mon Sep 17 00:00:00 2001 From: Taejeong Lee Date: Wed, 23 Jan 2013 11:12:43 +0900 Subject: [PATCH] PluginManager change to support tizen privilege policy. * For tizen app type, all plugin object loading is allowed. * Security check is performed on ace. [Issue#] N/A [Problem] Plugin support policy. [Cause] N/A [Solution] For tizen app type, all plugin object loading is allowed. Change-Id: I9761c2d7011a20682234d30f14c67796a437b8c1 --- src/modules/tizen/PluginManager/PluginManager.cpp | 87 ++++++++++++++++------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/src/modules/tizen/PluginManager/PluginManager.cpp b/src/modules/tizen/PluginManager/PluginManager.cpp index d7c6080..8f71524 100644 --- a/src/modules/tizen/PluginManager/PluginManager.cpp +++ b/src/modules/tizen/PluginManager/PluginManager.cpp @@ -188,40 +188,75 @@ Api::IPluginManager::PropertyList PluginManager::getProperties() const m_propertyCache = PropertyList(); - WrtDB::DbWidgetFeatureSet features; - Try + WrtDB::WidgetDAOReadOnly dao(m_widgetHandle); + string localUri = m_objectUri + SEPARATOR; + + if (dao.getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) { - WrtDB::WidgetDAOReadOnly dao(m_widgetHandle); - features = dao.getFeaturesList(); + WrtDB::PluginHandleList pluginHandleList = + WrtDB::PluginDAOReadOnly::getPluginHandleList(); + + FOREACH(it_pluginHandle, pluginHandleList) + { + WrtDB::ImplementedObjectsList implObjectList = + WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle( + *it_pluginHandle); + + FOREACH(it_implObject, implObjectList) + { + //check if implemented object stats with localUri + if (it_implObject->find(localUri) == 0) { + string property = *it_implObject; + //remove local uri that predicts property name. + property.erase(0, localUri.size()); + //check if property has its own properties. + size_t pos = property.find(SEPARATOR); + if (pos != string::npos) { + //if so then remove them. + property.erase(pos); + } + m_propertyCache->push_back(property); + } + } + } } - Catch(WrtDB::WidgetDAOReadOnly::Exception::Base) + else { - LogError("Cannot get feature list"); - ReThrow(Commons::PlatformException); - } + WrtDB::DbWidgetFeatureSet features; - string localUri = m_objectUri + SEPARATOR; - WrtDB::DbWidgetFeatureSet::const_iterator feature = features.begin(); - for (; feature != features.end(); ++feature) { - WrtDB::ImplementedObjectsList implObjs = - WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle( - feature->pluginId); - FOREACH(it, implObjs) { - //check if implemented object stats with localUri - if (it->find(localUri) == 0) { - string property = *it; - //remove local uri that predicts property name. - property.erase(0, localUri.size()); - //check if property has its own properties. - size_t pos = property.find(SEPARATOR); - if (pos != string::npos) { - //if so then remove them. - property.erase(pos); + Try + { + features = dao.getFeaturesList(); + } + Catch(WrtDB::WidgetDAOReadOnly::Exception::Base) + { + LogError("Cannot get feature list"); + ReThrow(Commons::PlatformException); + } + + WrtDB::DbWidgetFeatureSet::const_iterator feature = features.begin(); + for (; feature != features.end(); ++feature) { + WrtDB::ImplementedObjectsList implObjs = + WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle( + feature->pluginId); + FOREACH(it, implObjs) { + //check if implemented object stats with localUri + if (it->find(localUri) == 0) { + string property = *it; + //remove local uri that predicts property name. + property.erase(0, localUri.size()); + //check if property has its own properties. + size_t pos = property.find(SEPARATOR); + if (pos != string::npos) { + //if so then remove them. + property.erase(pos); + } + m_propertyCache->push_back(property); } - m_propertyCache->push_back(property); } } } + return *m_propertyCache; } -- 2.7.4