0N/A/**
553N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0N/A *
0N/A * Copyright (c) 2012 ForgeRock AS. All Rights Reserved
0N/A *
0N/A * The contents of this file are subject to the terms
0N/A * of the Common Development and Distribution License
0N/A * (the License). You may not use this file except in
0N/A * compliance with the License.
0N/A *
0N/A * You can obtain a copy of the License at
0N/A * http://forgerock.org/license/CDDLv1.0.html
0N/A * See the License for the specific language governing
0N/A * permission and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL
0N/A * Header Notice in each file and include the License file
0N/A * at http://forgerock.org/license/CDDLv1.0.html
553N/A * If applicable, add the following below the CDDL Header,
553N/A * with the fields enclosed by brackets [] replaced by
553N/A * your own identifying information:
0N/A * "Portions Copyrighted [year] [name of copyright owner]"
0N/A */
0N/A
0N/A/*global object */
0N/A
0N/Avar userId = object._id,
0N/A notificationPointer,
findUserNotificationsParams = {
"_queryId": "get-notifications-for-user",
"userId": userId
},
notificationQueryResult;
notificationQueryResult = openidm.query("repo/ui/notification", findUserNotificationsParams);
if (notificationQueryResult.result && notificationQueryResult.result.length!==0) {
for (notificationPointer=0;notificationPointer<notificationQueryResult.result.length;notificationPointer++) {
var notification = notificationQueryResult.result[notificationPointer];
openidm['delete']('repo/ui/notification/' + notification._id, notification._rev);
}
}