feat: add observer participant role for signature requests - #8143
Conversation
Introduce signer/observer participant roles at the database layer so request-signature flows can distinguish signing participants from view-only observers. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Allow administrators to enable observer participants through the policy workbench before requesters can assign view-only roles. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Persist participant roles, block observers from signing, and keep sequential signing logic scoped to actual signers only. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Replace the single add-signer action with an add dropdown, separate signers from observers in the participant list, and hide multi-signer controls when only one signer is present. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Run occ as www-data when setup runs as root and add a reusable script to reconfigure LibreSign after environment restarts. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Remove the experimental column that was not mapped by SignRequest and broke participant creation in local development databases. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Observers must not affect partial or fully signed file status, envelope progress, or pending signer checks used for signing order. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Send observer emails and in-app links to the validation page instead of the signing flow, and redirect legacy sign URLs to validation. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Show the plus icon and Add label on the participant dropdown action. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Group signers and observers in validation UI, recognize OBSERVING status, and ignore observers when checking partial or full signature completion. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Register observer UI strings in en_GB and translate the role as testemunha in pt_BR and pt_PT while keeping Observer in English. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Force-refresh validation data when opening the page right after signing so the first load does not fail before the signed document is ready. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Register Add and Add participant strings used by the request signature tab so the dropdown button is localized in English and Portuguese. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Switch SignerSelect copy and NcSelect input label based on participant role so adding a witness shows observer-specific search text. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Block observer-only signature requests in the UI and API, showing an error toast instead of treating the operation as successful. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Preserve observers when reordering signers, exclude them from DocMDP signer limits, map OBSERVING status in summaries, regenerate OpenAPI types, and add focused regression tests for policy and signing rules. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Keep lint-php-cs CI green after observer workflow changes. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
This reverts commit bd2f828. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
130da68 to
cfa42bc
Compare
Add a shared helper for the renamed Add participant control and update E2E specs that previously clicked the removed Add signer button. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Centralize account/email signer picking on the combobox used by the add-participant dialog so specs stop relying on removed placeholders. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Update request-signature E2E specs to select account and email signers through the shared combobox helpers. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
When an Everyone rule already exists, edit it instead of waiting for a missing Everyone scope option, and make save paths dirty the form first. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
…tate Reset stale certificates/signatures when needed, keep signature stamp in a graphic-capable mode, and click Sign document with a viewport-safe helper. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Translations under l10n/ are synced by Transifex; keep new strings only in source code until the bot updates locale files. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Resolve conflicts keeping observer participant behavior alongside the mail sender strategy policy and NcSelect validation updates from main. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Nextcloud entities expose getUuid through magic __call, so configuring getUuid directly on the File mock breaks MailServiceTest. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
NcSelect now exposes the method placeholder as the combobox name, so helpers must use #account-or-email-input instead of Search signer. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Resolve merge conflicts to keep participantRole observer support alongside signer geolocation policy changes from main. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Update unit test callbacks to expect participantRole before afterPersist after merging observer role support with signer geolocation changes. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
8a74b3e to
6c8ddb1
Compare
| return true | ||
| } | ||
|
|
||
| return participant.status === SIGN_REQUEST_STATUS.OBSERVING |
There was a problem hiding this comment.
Please use participantRole as the source of truth for the role.
OBSERVING is a status created by this feature, so we do not need it as a legacy fallback. With the current code, inconsistent data such as participantRole: signer with status: OBSERVING is treated as an observer.
The backend already stores the explicit role. The frontend should not silently change the role based on status. Please update the related unit test too.
There was a problem hiding this comment.
Please add one focused Playwright test for the observer workflow.
The PR changes many existing E2E tests, but none tests the new feature end to end.
The scenario should:
- enable
enable_observer_profile; - add one signer and one observer;
- request signatures;
- verify both roles are shown separately;
- open the observer link;
- verify the observer goes to validation and cannot enter the signing flow.
This will test the main business flow instead of only the individual frontend and backend pieces.
We also need similar scenario at integration tests with Behat to validate the API contract too.
| $this->mailer->expects($this->once()) | ||
| ->method('send'); | ||
|
|
||
| $signRequest = $this->createMock(SignRequest::class); |
There was a problem hiding this comment.
Could we use a real SignRequest entity here instead of mocking __call()?
This test only needs entity data such as UUID, file ID, display name, and participant role. Using the real entity will make the test easier to read and less coupled to the entity magic methods.
The same approach can be used for the file entity if possible.
Official migrations must not drop an unknown column created only in local or experimental environments. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Persisted roles are always valid after migration, so invalid values must fail rather than silently become signer. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Changing signer to observer after signing would rewrite participant meaning in audit history. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Stop inferring observer status from OBSERVING when the explicit role is already stored by the backend. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
The Add menu is only needed when enable_observer_profile is enabled, preserving the previous UI and reducing unrelated E2E churn. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Keeps observer notification coverage focused on data instead of Entity magic-method plumbing. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Add focused Playwright and Behat scenarios for enabling observers, separating roles, validation links, and blocked signing. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Resolves: #6957
📝 Summary
Adds an observer participant role (UI label: Observer / Testemunha) to signature requests. Observers can be invited to follow document progress and open the validation view, but cannot sign. The feature is gated by the new policy
enable_observer_profile(default: disabled).Backend is the source of truth: role validation, signing denial, status/progress calculations, DocMDP signer limits, sequential signing, e-mail/notification routing, and API contracts all treat observers separately from signers. The request UI exposes separate Signers and Observers lists when the policy is enabled.
Also includes pre-merge hardening: preserve observers when reordering signers in ordered flow, require at least one signer before requesting signatures, regenerate OpenAPI/TypeScript types, and focused regression tests.
🧪 How to test
🎨 UI / Front‑end changes
file.signers🚧 Tasks
l10n/edits included for dev)⚙️ API / Back‑end changes
participant_rolecolumn on sign requests (signer|observer) with idempotent migrationenable_observer_profile(defaultfalse, system/group/user scopes)OBSERVING(status3) in signer summaries; defensiveParticipantRole::fromNullable()composer openapiif necessary🚧 Tasks
participant_profile_idcolumn (migration included)✅ Checklist
composer openapi,npm run typescript:generate)composer cs:check)🤖 AI (if applicable)