Skip to content

Commit c155596

Browse files
committed
restrict notifications to allowed users
1 parent 0eec29b commit c155596

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

connect/connectNotificationServer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ const handler = (topic, message, logger, callback) => {
319319
)).then((notifications) => {
320320
allNotifications = _.filter(notifications, notification => notification.userId !== `${message.initiatorUserId}`);
321321

322+
if (eventConfig.includeUsers){
323+
allNotifications = _.filter(allNotifications, notification => message[eventConfig.includeUsers].contains(notification.userId));
324+
}
325+
322326
// now let's retrieve some additional data
323327

324328
// if message has userId such messages will likely need userHandle and user full name

connect/events-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ const EVENTS = [
145145
type: BUS_API_EVENT.CONNECT.PROJECT.FILE_UPLOADED,
146146
version: 2,
147147
projectRoles: [PROJECT_ROLE_OWNER, PROJECT_ROLE_COPILOT, PROJECT_ROLE_MANAGER, PROJECT_ROLE_MEMBER],
148+
includeUsers: 'allowedUsers'
148149
}, {
149150
type: BUS_API_EVENT.CONNECT.PROJECT.SPECIFICATION_MODIFIED,
150151
version: 2,

0 commit comments

Comments
 (0)