diff options
author | hs321.lee <hs321.lee@samsung.com> | 2013-04-11 21:46:03 +0900 |
---|---|---|
committer | hs321.lee <hs321.lee@samsung.com> | 2013-04-12 09:23:49 +0900 |
commit | 422c16e9497ba889ae0e654b271565de129bbdb7 (patch) | |
tree | ffb03ac61a278d54e30119ef41325592aeaba131 | |
parent | 6af277a8bacc1f088a1a346640084a930fad8777 (diff) | |
download | social-422c16e9497ba889ae0e654b271565de129bbdb7.tar.gz social-422c16e9497ba889ae0e654b271565de129bbdb7.tar.bz2 social-422c16e9497ba889ae0e654b271565de129bbdb7.zip |
Add the E_USER_NOT_CONSENTED exception in calendarbook apis
Change-Id: I5b0f17d21e1bcf56d8f2619fb207a082f4d657a1
Signed-off-by: hs321.lee <hs321.lee@samsung.com>
-rw-r--r-- | inc/FSclCalendarbook.h | 37 | ||||
-rw-r--r-- | src/FSclCalendarbook.cpp | 219 |
2 files changed, 159 insertions, 97 deletions
diff --git a/inc/FSclCalendarbook.h b/inc/FSclCalendarbook.h index c58d131..735632d 100644 --- a/inc/FSclCalendarbook.h +++ b/inc/FSclCalendarbook.h @@ -1,7 +1,7 @@ -//
+//
// Open Service Platform
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -380,6 +380,7 @@ public: * @param[in,out] event The event to add
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c event is invalid.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -399,6 +400,7 @@ public: * @param[in] calendarId The calendar ID
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c event is invalid. @n
* - The specified @c calendarId is invalid. @n
@@ -421,6 +423,7 @@ public: * @param[in,out] todo The to-do to add
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c todo is invalid.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -440,6 +443,7 @@ public: * @param[in] calendarId The calendar ID
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c todo is invalid. @n
* - The specified @c calendarId is invalid. @n
@@ -462,6 +466,7 @@ public: * @param[in] event The calendar event to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c recordId is #INVALID_RECORD_ID.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n
@@ -481,6 +486,7 @@ public: * @param[in] eventId The calendar event ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c eventId is #INVALID_RECORD_ID.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_INVALID_OPERATION This method cannot be used for the recurrence exception of the recurring event. @n
@@ -501,6 +507,7 @@ public: * @param[in] todo The CalTodo ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c recordId is #INVALID_RECORD_ID.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -518,6 +525,7 @@ public: * @param[in] todoId The CalTodo ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified input parameter is invalid.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -535,6 +543,7 @@ public: * @param[in] event The CalEvent instance to update
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c recordId is #INVALID_RECORD_ID. @n
* - The specified @c event is not #RECORD_TYPE_EVENT. @n
@@ -559,6 +568,7 @@ public: * @param[in] todo The CalTodo instance to update
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c recordId is #INVALID_RECORD_ID, or the date of the to-do item is invalid. @n
* The valid range of the date can be referenced from GetMaxDateTime() and GetMinDateTime().
* @exception E_OBJ_NOT_FOUND The specified record is not found.
@@ -577,6 +587,7 @@ public: * @param[in] eventId The event ID to find
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c eventId is invalid.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -595,6 +606,7 @@ public: * @param[in] todoId The ID of the to-do to find
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c todoId is invalid.
* @exception E_OBJ_NOT_FOUND The specified record is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -634,6 +646,7 @@ public: * The default priority value is #TODO_PRIORITY_ALL that means all the priorities are returned.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c pageNo or @c countPerPage is less than @c 1. @n
* - The start time is later than the end date. @n
@@ -686,6 +699,7 @@ public: * The default priority value is #TODO_PRIORITY_ALL that means all the priorities are returned.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The start time is later than the end date. @n
* - The start or end time is out of the valid range. @n
@@ -736,6 +750,7 @@ public: * The default category value is #EVENT_CATEGORY_ALL, which means all the categories are returned.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c pageNo or @c countPerPage is less than @c 1. @n
* - The specified @c category is invalid. @n
@@ -780,6 +795,7 @@ public: * @param[in] listener The listener for receiving the responses of the request
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c pageNo or @c countPerPage is less than @c 1. @n
* - The specified @c category is invalid. @n
@@ -807,6 +823,7 @@ public: * The results are listed in the order of their event ID.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
@@ -827,6 +844,7 @@ public: * The results are listed in the order of their to-do ID.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
@@ -847,6 +865,7 @@ public: * The results are listed in the order of their calendar ID.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @remarks There is a high probability for an occurrence of an out-of-memory exception. If possible, check whether the exception is
@@ -869,6 +888,7 @@ public: * @param[out] latestVersion The latest change version among the changed events
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c version is invalid.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
@@ -892,6 +912,7 @@ public: * @param[out] latestVersion The latest change version among the changed to-dos
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c version is invalid.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
@@ -913,6 +934,7 @@ public: * @param[in,out] calendar The calendar to add
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The record ID of the calendar is not #INVALID_RECORD_ID.
* @exception E_STORAGE_FULL The storage is insufficient.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -932,6 +954,7 @@ public: * @param[in] accountId The account Id
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The record ID of the calendar is not #INVALID_RECORD_ID. @n
* - The specified @c accountId is invalid.
@@ -952,6 +975,7 @@ public: * @param[in] calendarId The calendar ID to remove
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c calendarId is invalid, or
* the calendar represents default calendar.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
@@ -970,6 +994,7 @@ public: * @param[in] calendar The Calendar instance to update
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The calendar's recordId is #INVALID_RECORD_ID, or
* the calendar represents default calendar.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
@@ -989,6 +1014,7 @@ public: * @param[in] calendarId The calendar ID
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c calendarId is invalid.
* @exception E_OBJ_NOT_FOUND The specified calendar is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -1009,6 +1035,7 @@ public: * The @c eventInstance must be an instance of the recurring event.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The instance is invalid.
* @exception E_OBJ_NOT_FOUND The original event of the @c eventInstance is not found.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
@@ -1067,6 +1094,7 @@ public: * @param[in,out] event The modified copy of the original event @n
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method.
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The instance is invalid. @n
* - @c event is not referring to the original event.
@@ -1085,6 +1113,7 @@ public: * @return The latest version
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
@@ -1109,6 +1138,7 @@ public: * @param[in] maxCount The maximum count of the searched results @n If this value is @c 0, it will be ignored.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_INVALID_ARG The specified @c offset or @c maxCount is less than 0, or the @c propertySortedBy is not an element of the enumerator that corresponds with the type of the specified @c filter.
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
@@ -1135,6 +1165,7 @@ public: * @param[in] filter The filter that specifies the search condition @n If the filter is empty, all items that are specified by the type of this filter will be searched.
* @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1
* @exception E_SYSTEM The method cannot proceed due to a severe system error.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
diff --git a/src/FSclCalendarbook.cpp b/src/FSclCalendarbook.cpp index 84dd6fe..3e15340 100644 --- a/src/FSclCalendarbook.cpp +++ b/src/FSclCalendarbook.cpp @@ -124,12 +124,13 @@ CATCH: result Calendarbook::AddEvent(CalEvent& event) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->AddEvent(event); + r = __pCalendarbookImpl->AddEvent(event); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -138,12 +139,13 @@ Calendarbook::AddEvent(CalEvent& event) result Calendarbook::AddEvent(CalEvent& event, RecordId calendarId) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->AddEvent(event, calendarId); + r = __pCalendarbookImpl->AddEvent(event, calendarId); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -152,12 +154,13 @@ Calendarbook::AddEvent(CalEvent& event, RecordId calendarId) result Calendarbook::AddTodo(CalTodo& todo) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->AddTodo(todo); + r = __pCalendarbookImpl->AddTodo(todo); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -166,12 +169,13 @@ Calendarbook::AddTodo(CalTodo& todo) result Calendarbook::AddTodo(CalTodo& todo, RecordId calendarId) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->AddTodo(todo, calendarId); + r = __pCalendarbookImpl->AddTodo(todo, calendarId); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -180,12 +184,13 @@ Calendarbook::AddTodo(CalTodo& todo, RecordId calendarId) result Calendarbook::RemoveEvent(CalEvent& event) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->RemoveEvent(event); + r = __pCalendarbookImpl->RemoveEvent(event); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -194,12 +199,13 @@ Calendarbook::RemoveEvent(CalEvent& event) result Calendarbook::RemoveEvent(RecordId eventId) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->RemoveEvent(eventId); + r = __pCalendarbookImpl->RemoveEvent(eventId); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -208,12 +214,13 @@ Calendarbook::RemoveEvent(RecordId eventId) result Calendarbook::RemoveTodo(CalTodo& todo) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->RemoveTodo(todo); + r = __pCalendarbookImpl->RemoveTodo(todo); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -222,12 +229,13 @@ Calendarbook::RemoveTodo(CalTodo& todo) result Calendarbook::RemoveTodo(RecordId todoId) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->RemoveTodo(todoId); + r = __pCalendarbookImpl->RemoveTodo(todoId); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -236,12 +244,13 @@ Calendarbook::RemoveTodo(RecordId todoId) result Calendarbook::UpdateEvent(const CalEvent& event) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->UpdateEvent(event); + r = __pCalendarbookImpl->UpdateEvent(event); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -250,12 +259,13 @@ Calendarbook::UpdateEvent(const CalEvent& event) result Calendarbook::UpdateTodo(const CalTodo& todo) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->UpdateTodo(todo); + r = __pCalendarbookImpl->UpdateTodo(todo); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -264,13 +274,14 @@ Calendarbook::UpdateTodo(const CalTodo& todo) CalEvent* Calendarbook::GetEventN(RecordId eventId) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); CalEvent* pEvent = __pCalendarbookImpl->GetEventN(eventId); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pEvent; @@ -279,13 +290,14 @@ Calendarbook::GetEventN(RecordId eventId) const CalTodo* Calendarbook::GetTodoN(RecordId todoId) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); CalTodo* pTodo = __pCalendarbookImpl->GetTodoN(todoId); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pTodo; @@ -295,13 +307,14 @@ IList* Calendarbook::GetTodosN(const DateTime& start, const DateTime& end, int pageNo, int countPerPage, unsigned long status, unsigned long priority) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetTodosN(start, end, pageNo, countPerPage, status, priority); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -310,13 +323,14 @@ Calendarbook::GetTodosN(const DateTime& start, const DateTime& end, int pageNo, int Calendarbook::GetTodoCount(const DateTime& start, const DateTime& end, unsigned long status, unsigned long priority) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, _INVALID_COUNT, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_COUNT, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); int count = __pCalendarbookImpl->GetTodoCount(start, end, status, priority); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_COUNT, r, "[%s] Propagating.", GetErrorMessage(r)); return count; @@ -327,12 +341,13 @@ Calendarbook::GetEventInstancesN(const DateTime& start, const DateTime& end, const Tizen::Locales::TimeZone& timeZone, int pageNo, int countPerPage, unsigned long category) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetEventInstancesN(start, end, timeZone, pageNo, countPerPage, category); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -344,12 +359,13 @@ Calendarbook::GetEventInstances(const DateTime& start, const DateTime& end, RequestId& reqId, const IRecordListener& listener) const { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->GetEventInstances(start, end, timeZone, pageNo, countPerPage, category, reqId, listener); + r = __pCalendarbookImpl->GetEventInstances(start, end, timeZone, pageNo, countPerPage, category, reqId, listener); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -358,13 +374,14 @@ Calendarbook::GetEventInstances(const DateTime& start, const DateTime& end, IList* Calendarbook::GetAllEventsN(void) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetAllEventsN(); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -373,13 +390,14 @@ Calendarbook::GetAllEventsN(void) const IList* Calendarbook::GetAllTodosN(void) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetAllTodosN(); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -388,13 +406,14 @@ Calendarbook::GetAllTodosN(void) const IList* Calendarbook::GetAllCalendarsN(void) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetAllCalendarsN(); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -403,13 +422,14 @@ Calendarbook::GetAllCalendarsN(void) const IList* Calendarbook::GetChangedEventsAfterN(int version, int& latestVersion) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetChangedEventsAfterN(version, latestVersion); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -418,13 +438,14 @@ Calendarbook::GetChangedEventsAfterN(int version, int& latestVersion) const IList* Calendarbook::GetChangedTodosAfterN(int version, int& latestVersion) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->GetChangedTodosAfterN(version, latestVersion); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -433,12 +454,13 @@ Calendarbook::GetChangedTodosAfterN(int version, int& latestVersion) const result Calendarbook::AddCalendar(Calendar& calendar) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->AddCalendar(calendar); + r = __pCalendarbookImpl->AddCalendar(calendar); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -447,12 +469,13 @@ Calendarbook::AddCalendar(Calendar& calendar) result Calendarbook::AddCalendar(Calendar& calendar, AccountId accountId) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->AddCalendar(calendar, accountId); + r = __pCalendarbookImpl->AddCalendar(calendar, accountId); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -461,12 +484,13 @@ Calendarbook::AddCalendar(Calendar& calendar, AccountId accountId) result Calendarbook::RemoveCalendar(RecordId calendarId) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->RemoveCalendar(calendarId); + r = __pCalendarbookImpl->RemoveCalendar(calendarId); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -475,12 +499,13 @@ Calendarbook::RemoveCalendar(RecordId calendarId) result Calendarbook::UpdateCalendar(const Calendar& calendar) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->UpdateCalendar(calendar); + r = __pCalendarbookImpl->UpdateCalendar(calendar); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -489,13 +514,14 @@ Calendarbook::UpdateCalendar(const Calendar& calendar) Calendar* Calendarbook::GetCalendarN(RecordId calendarId) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); Calendar* pCalendar = __pCalendarbookImpl->GetCalendarN(calendarId); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pCalendar; @@ -504,12 +530,13 @@ Calendarbook::GetCalendarN(RecordId calendarId) const result Calendarbook::RemoveEventInstance(const CalEventInstance& eventInstance) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->RemoveEventInstance(eventInstance); + r = __pCalendarbookImpl->RemoveEventInstance(eventInstance); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -518,12 +545,13 @@ Calendarbook::RemoveEventInstance(const CalEventInstance& eventInstance) result Calendarbook::UpdateEventInstance(const CalEventInstance& eventInstance, CalEvent& event) { - SysTryReturnResult(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE) == E_SUCCESS, - E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_WRITE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); - result r = __pCalendarbookImpl->UpdateEventInstance(eventInstance, event); + r = __pCalendarbookImpl->UpdateEventInstance(eventInstance, event); SysTryReturn(NID_SCL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); return E_SUCCESS; @@ -532,13 +560,14 @@ Calendarbook::UpdateEventInstance(const CalEventInstance& eventInstance, CalEven int Calendarbook::GetLatestVersion(void) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_VERSION, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); int version = __pCalendarbookImpl->GetLatestVersion(); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_VERSION, r, "[%s] Propagating.", GetErrorMessage(r)); return version; @@ -547,13 +576,14 @@ Calendarbook::GetLatestVersion(void) const IList* Calendarbook::SearchN(const CalendarbookFilter& filter, unsigned long propertySortedBy, SortOrder sortOrder, int offset, int maxCount) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); IList* pList = __pCalendarbookImpl->SearchN(filter, propertySortedBy, sortOrder, offset, maxCount); - result r = GetLastResult(); + r = GetLastResult(); SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); return pList; @@ -562,14 +592,15 @@ Calendarbook::SearchN(const CalendarbookFilter& filter, unsigned long propertySo int Calendarbook::GetMatchedItemCount(const CalendarbookFilter& filter) const { - SysTryReturn(NID_SCL, _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ) == E_SUCCESS, null, - E_PRIVILEGE_DENIED, "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method."); + result r = _AccessController::CheckUserPrivilege(_PRV_CALENDAR_READ); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_COUNT, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysAssertf(__pCalendarbookImpl != null, "Not yet constructed. Construct() should be called before use."); int count = __pCalendarbookImpl->GetMatchedItemCount(filter); - result r = GetLastResult(); - SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_VERSION, r, "[%s] Propagating.", GetErrorMessage(r)); + r = GetLastResult(); + SysTryReturn(NID_SCL, r == E_SUCCESS, _INVALID_COUNT, r, "[%s] Propagating.", GetErrorMessage(r)); return count; } |