#include <TimeUtilConverter.h>
#include <JSTZDate.h>
#include <JSWebAPIErrorFactory.h>
+#include <Security.h>
#include <SecurityExceptions.h>
#include <GlobalContextManager.h>
#include <TimeTracer.h>
CalendarEventPtr event(new CalendarEvent());
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
+ DeviceAPI::Common::SecurityAccessor *securityAccessor = NULL;
+
+ try
+ {
+ securityAccessor = DeviceAPI::Common::JSObjectGetSecurityAccessor(context, constructor);
+ }
+ catch(BasePlatformException &e)
+ {
+ event->setCalendarType(CalendarEvent::EVENT_TYPE);
+ return createJSCalendarEvent(globalContext, event, securityAccessor);
+ }
+
Try
{
CalendarConverter converter(globalContext);
}
event->setCalendarType(CalendarEvent::EVENT_TYPE);
- return createJSCalendarEvent(globalContext, event);
+ return createJSCalendarEvent(globalContext, event, securityAccessor);
}
Catch(UnsupportedException)
{
}
event->setCalendarType(CalendarEvent::EVENT_TYPE);
- return createJSCalendarEvent(globalContext, event);
+ return createJSCalendarEvent(globalContext, event, securityAccessor);
}
-JSObjectRef JSCalendarEvent::createJSCalendarEvent(JSContextRef context, CalendarEventPtr event)
+JSObjectRef JSCalendarEvent::createJSCalendarEvent(JSContextRef context, CalendarEventPtr event, const DeviceAPI::Common::SecurityAccessor *securityAccessor)
{
CalendarEventPrivObject *priv = new CalendarEventPrivObject(context, event);
+ priv->copyAceCheckAccessFunction(securityAccessor);
return JSObjectMake(context, getClassRef(), priv);
}
CalendarEventPrivObject *privateObject =
static_cast<CalendarEventPrivObject*>(JSObjectGetPrivate(thisObject));
- AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_EXPAND_RECURRENCE);
-
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CALENDAR_FUNCTION_API_EXPAND_RECURRENCE);
Try
{
dplEvent->setEvent(event);
dplEvent->setStartDate(startDate);
dplEvent->setEndDate(endDate);
+ dplEvent->copyAceCheckAccessFunction(privateObject);
m_calendar->expandEventRecurrence(dplEvent);
TIME_TRACER_ITEM_END(__FUNCTION__, 0);