Discussion Forum to Access Requirement

Discussion Forum to Access Requirement

Introduction

This document outlines proposed updates to the Synapse Discussion Forum architecture to decouple it from project‑only usage and make it generally applicable to multiple object types, including Access Requirements (ARs).

Current Discussion Forum Architecture

The current Synapse Discussion Forum, described in detail at
Synapse Discussion Forum, has the following characteristics:

  • Single Forum per Project

    • Each Synapse project is associated with exactly one Forum.

    • That Forum includes:

      • One or more Moderators

      • Multiple Threads

      • Multiple Replies per thread

  • Scope

    • All project‑related discussions (analysis questions, support, challenges, etc.) take place in this single project‑level Forum.

New Requirements

PLFM-9390 - Getting issue details... STATUS

Implement a lightweight discussion forum tied to each AR and a discussion thread to each data access submission.This capability enables ACT and DAC members to coordinate review activities within the system while maintaining compliance with external governance policies,

  1. Forum per Project (unchanged)

    • A project can still have a top‑level Forum for general project discussions.

  2. Forum per Access Requirement (new)

    • Synapse defines multiple Access Requirements (ARs) that can apply to entities such as projects, folders, or files.

    • For each AR, there should be its own Forum, distinct from the project’s general Forum.

  3. Discussion thread for each submission (Data Access request)
    For every submitted Data Access Request associated with an AR, create a dedicated discussion thread in that AR’s Forum.

Proposed Design Changes

To support these requirements, we will evolve the data model and APIs as follows:

  1. Forum scoping

    • Extend the Forum model to support two kinds of owners:

      • projectId (project‑level Forum)

      • accessRequirementId (AR‑level Forum)

    • Enforce:

      • At most one Forum per projectId.

      • At most one Forum per accessRequirementId.

      •  

  2. Forum creation / lookup APIs

    • Generalize “Get Forum for Project” to “Get Forum for Owner”:

      • GET /forum?projectId={projectId} – returns the project‑level Forum. (existing)

      • GET /forum?objectId={objectId}&objectType={objectType} – returns the Forum for a specific Object. If the objectType is null default object type will be ENTITY. (new)

 

  1. Threads and Replies (unchanged usage, new context)

    • The Thread and Reply models and APIs remain the same, but:

      • Threads for AR discussions are simply created in the AR Forum instead of the project Forum.

    • All existing moderation, pagination, and notification behavior applies equally to project‑level and AR‑level Forums.

 

Database Changes

Forum-ddl.sql

CREATE TABLE IF NOT EXISTS `FORUM` ( `ID` BIGINT NOT NULL, `OBJECT_ID` BIGINT NOT NULL, `OBJECT_TYPE` ENUM('ENTITY', 'ACCESS_REQUIREMENT'), `ETAG` char(36) NOT NULL, PRIMARY KEY ('ID'), UNIQUE KEY `FORUM_BACK_UP_ID` (`OBJECT_ID`, `OBJECT_TYPE`) )

 

Backfilling

All existing rows in the FORUM table should be backfilled so that OBJECT_ID is set to the corresponding project ID and OBJECT_TYPE is set to ENTITY.

 

Forum for Access Requirements (ARs)

Creating a Forum for an AR

A dedicated Forum is created when a new Access Requirement (AR) is created.

Retrieving a Forum for an AR

A new API, GET /forum?objectId={objectId}&objectType={objectType}, will return the Forum associated with the specified AR.

 

Discussion Thread for Each Submitted Data Access Request to an AR

For every submitted Data Access Request associated with an Access Requirement (AR), we will create a corresponding discussion thread.

The API
https://repo-prod.prod.sagebase.org/repo/v1/dataAccessRequest/{requestId}/submission

is used to submit a request. When this endpoint is called:

  1. A submission record is created in the database. (existing)

  2. A notification email is sent to all users who have the ACCESS_TYPE.REVIEW_SUBMISSIONS permission.(existing)

  3. In addition, a new discussion thread is created for the submission. (new)

DBODiscussionThread dbo = new DBODiscussionThread(); dbo.setId(Long.parseLong(id)); dbo.setForumId(Long.parseLong(forumId)); dbo.setTitle(title.getBytes(UTF8)); // the tille will be submissionId:123 dbo.setMessageKey(messageKey); // the message will be empty dbo.setCreatedBy(userId); // a service user dbo.setIsEdited(false); dbo.setIsDeleted(false); dbo.setIsPinned(false); dbo.setCreatedOn(new Date()); dbo.setModifiedOn(new Date()); dbo.setEtag(etag);

 

Normally, when we create a new thread, the creating user is added to the Subscription table, making them a follower of the thread. Followers receive email notifications when replies are posted.

In this case, we do not want the submitter to receive notifications that the request was submitted. Instead, only reviewers should be notified of the new submission (which already occurs via the existing email sent to users with ACCESS_TYPE.REVIEW_SUBMISSIONS). Therefore, for these auto‑created submission threads, we will not add the submitter to the Subscription table.

 

Get thread for submission

The UI must be able to retrieve the discussion thread associated with a given submission. Use the following new endpoint:

https://repo-prod.prod.sagebase.org/repo/v1/thread/submission/{submissionId}/

Request Object: None

Response Object : DiscussionThreadBundle

 

Database changes:

DiscussionThreadSubmissionReference-ddl.sql

CREATE TABLE IF NOT EXISTS `DISCUSSION_THREAD_SUBMISSION_REFERENCE` ( `THREAD_ID` BIGINT NOT NULL, `SUBMISSION_ID` BIGINT NOT NULL, PRIMARY KEY (`THREAD_ID`, `SUBMISSION_ID`), INDEX `DISCUSSION_THREAD_SUBMISSION_REFERENCE_SUBMISSION)ID_INDEX` (`SUBMISSION_ID`), CONSTRAINT `DISCUSSION_THREAD_SUBMISSION_REFERENCE_THREAD_ID_FK` FOREIGN KEY (`THREAD_ID`) REFERENCES `DISCUSSION_THREAD` (`ID`) ON DELETE CASCADE, CONSTRAINT `DISCUSSION_THREAD_SUBMISSION_REFERENCE_SUBMISSION_FK` FOREIGN KEY (`SUBMISSION_ID`) REFERENCES `SUBMISSION` (`ID`) ON DELETE CASCADE )

 

 

Get Discussion Threads for an AR Forum

To retrieve all discussion threads for an AR, use this API to fetch a specified number of discussion threads for a given forum ID:
https://repo-prod.prod.sagebase.org/repo/v1/forum/{forumId}/threads

 

Access to discussions

Only ACT and User has ACCESS_TYPE.REVIEW_SUBMISSIONS for the submission can access the discussions.

The backend will expose an API that, given an Access Requirement (AR) ID, returns the caller’s permissions for that AR:

https://repo-prod.prod.sagebase.org/repo/v1/accessRequirement/{requirementId}/permissions

Request object : None

Response object :

class AccessRequirementPermissions{ boolean hasPermission }

 

Notification of Thread

Currently, when a new reply is posted to a thread, email notifications are sent only to users who are already followers (subscribers) of that thread. We do not parse the thread title or message body for @username mentions, nor do we send separate notifications based on mentions.

PLFM-9390 introduces a new requirement: “Enable users to mention (i.e., @username) to trigger targeted (email) notifications to the mentioned user to view the submission in Synapse.”

There are two possible approaches to support this:

  1. Auto‑subscribe all reviewers
    Automatically add all users with ACCESS_TYPE.REVIEW_SUBMISSIONS to the Subscription table for the thread, so they receive notifications for new replies.

When a new thread is created by the backend, it will start with no subscribers. When a reply is posted to the thread, the replying user will be automatically subscribed to that thread. Subscription emails always include an unsubscribe link, and users can opt out of the thread’s notifications at any time.

  1. Mention‑based subscription
    Parse each thread message for @username mentions and, for each mentioned user who has the appropriate access, add them to the Subscription table so they receive notifications. For project-level threads, the user must have at least READ permission on the project. For submission-related threads, the user must have ACCESS_TYPE.REVIEW_SUBMISSIONS for the submission. This would change the current behavior of discussion threads and would require parsing all messages (since @username may appear in either the original thread message or any reply).

Today in Synapse, we support mention-based notifications: when a user is @‑mentioned in a thread or a reply (for example, @username), that user receives a notification

BroadcastMessageManagerImpl.sendMessageToNonSubscribers() Which reads the message text and get @user list from it. Current email template example Hello Sandhra (SSokhal), jay replied to syn123 (Thread link) thread in Sandhra_Project2(Project Link) forum. Here's a reply, are you notified by email of this reply? Unsubscribe from the thread New email template If thread is related to AR then include AR link otherwise Project link.

 

Ann Novakowski
March 17, 2026

Email content includes Rows 5-11. Row 9 is the actual post by user (which is fine). I would just want to ensure the link back to Synapse is to the submission + thread (and not the AR + forum) since this is what the external user has access to

Jay Hodgson
March 18, 2026

I think the link will be to Access Requirement (owner object type) and thread id. The frontend will need to be changed to look for a thread ID, and if present then get the associated submission and redirect.

All users (including external reviewers) have access to the Access Requirement, so this should not be an issue.

Later, if needed, we can investigate surfacing the Forum on the Access Requirement page, but I’m pushing to a later phase (if this functionality is requested).

Jay Hodgson
March 18, 2026

Note, I created this ticket a couple of days ago specifically to track implementation of this functionality in the client: inlineExtension