#include "EventSendMessagePrivateData.h" //for send message
#include "EventMessagingServicePrivateData.h"
#include "MessageAsyncCallbackManager.h"
-#include "plugin_config.h"
+#include "plugin_config_impl.h"
using namespace std;
return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
}
-JSObjectRef JSMessagingService::createJSObject(JSContextRef context, const IMessagingServicePtr &messagingService)
+JSObjectRef JSMessagingService::createJSObject(JSContextRef context, const IMessagingServicePtr &messagingService, const DeviceAPI::Common::SecurityAccessor *securityAccessor)
{
JSMessagingServicePriv* priv = new JSMessagingServicePriv( context, messagingService); //make private class.
+ priv->copyAceCheckAccessFunction(securityAccessor);
return JSObjectMake(context, getClassRef(), priv);
}
LoggerD("type" << ": " << storagePrivObj->m_type);
MessagingStoragePriv *privStorage = new MessagingStoragePriv(l_globalContext, storagePrivObj);
+ privStorage->copyAceCheckAccessFunction(priv);
return JSObjectMake(l_globalContext, JSMessagingStorage::getClassRef(), privStorage);
}
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (priv)
{
- AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
- MessagingExportedNames[MESSAGING_FUNCTION_API_CREATE_MESSAGE]);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ //check permission.
+ TIZEN_CHECK_ACCESS(context, exception, priv, MESSAGING_FUNCTION_API_CREATE_MESSAGE);
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
{
LoggerD("Entered");
- //check permission.
- AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
- MessagingExportedNames[MESSAGING_FUNCTION_API_SEND_MESSAGE]);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
LoggerE("Private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
+ //check permission.
+ TIZEN_CHECK_ACCESS(context, exception, priv, MESSAGING_FUNCTION_API_SEND_MESSAGE);
+
JSContextRef globalContext = priv->getContext();
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(globalContext);
{
LoggerD("Entered");
- //check permission.
- AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
- MessagingExportedNames[MESSAGING_FUNCTION_API_LOAD_MESSAGE_BODY]);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
LoggerE("Private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
+ //check permission.
+ TIZEN_CHECK_ACCESS(context, exception, priv, MESSAGING_FUNCTION_API_LOAD_MESSAGE_BODY);
+
JSContextRef globalContext = priv->getContext(); //create global Context
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(globalContext);
{
LoggerD("Entered");
- //check permission.
- AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
- MessagingExportedNames[MESSAGING_FUNCTION_API_LOAD_MESSAGE_ATTACHMENT]);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
LoggerE("Private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
+ //check permission.
+ TIZEN_CHECK_ACCESS(context, exception, priv, MESSAGING_FUNCTION_API_LOAD_MESSAGE_ATTACHMENT);
+
JSContextRef globalContext = priv->getContext(); //create global Context
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(globalContext);
{
LoggerD("Entered");
- //check permission.
- AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
- MessagingExportedNames[MESSAGING_FUNCTION_API_SYNC]);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
LoggerE("Private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
+ //check permission.
+ TIZEN_CHECK_ACCESS(context, exception, priv, MESSAGING_FUNCTION_API_SYNC);
+
JSContextRef globalContext = priv->getContext(); //get global Context
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(globalContext);
{
LoggerD("Entered");
- //check permission
- AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
- MessagingExportedNames[MESSAGING_FUNCTION_API_SYNC_FOLDER]);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
LoggerE("Private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
+ //check permission.
+ TIZEN_CHECK_ACCESS(context, exception, priv, MESSAGING_FUNCTION_API_SYNC_FOLDER);
+
JSContextRef globalContext = priv->getContext(); //get global Context
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = JSCallbackManager::createObject(globalContext);