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>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
|
If possible, could you also add a few screenshots to the PR description showing the observer flow? It would be useful to show:
Also, sorry for reviewing this PR while it is still a draft. I added the comments now only to help keep the work close to the expected flow and avoid bigger changes later. For the next review, it is better to add me as a reviewer and request the review when the PR is ready and is no longer a draft. After pushing new changes, when the PR is ready for review again, use the GitHub option to request my review again. This makes it clear when a new review is needed. |
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
No problem, I left it as a draft after the changes you requested. I was fixing the tests that broke. I'm going to add the observer flow and let you know when it's ready for review. |
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Existing requests without enable_observer_profile in policy_snapshot must stay disabled even if the live policy is later turned on. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Sign requests are linked to the envelope, so the observer policy must be frozen there as well as on child files. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
vitormattos
left a comment
There was a problem hiding this comment.
Only a small change:
At file appinfo/info.xml, change from:
16.0.0-dev.1
to:
16.0.0-dev.2
This will make all environments of all developers to run the migration because will identify that the version was changed.
Trigger migrations in all development environments after the version change. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
|
Could you also check this?
|
|
I found another case during manual testing. I created a signature request with one signer while the Observer policy was disabled. Then I enabled the Observer policy in Administration Settings and opened the same request again. The UI correctly showed
This happens because the frontend uses the current policy, while the backend keeps the old I think the expected behavior should be:
The saved policy state may need to move from There is also a frontend error handling problem in this case. The API returned HTTP 422 with the message
Please add regression tests for both parts:
|
… is enabled Requests created with Observer disabled can add observers after the live policy is turned on, then keep that snapshot enabled for the same flow. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Keep the identify-signer modal open and display the 422 OCS message instead of a generic fallback. Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
vitormattos
left a comment
There was a problem hiding this comment.
I also found a frontend issue during manual testing.
Observers are shown in the Signature positions screen and can be selected to add a visible signature position.
This is in src/components/Request/VisibleElements.vue, where both sidebarSigners and pdfEditorSigners use all participants without filtering by role.
Only participants with the signer role should be available in this screen.
Please filter observers from both lists and add a frontend test with one signer and one observer. The test should confirm that only the signer is shown.
| await setSystemPolicy(page.request, 'make_validation_url_private', '0') | ||
| await setSystemPolicy( | ||
| page.request, | ||
| 'identify_methods', |
There was a problem hiding this comment.
I found a problem during manual testing with mixed identify methods.
I enabled Account and Email identification, added the admin as a signer using Account, and added an observer using Email.
The signature request was created, but the observer never received the email with the link to view the document.
The current Playwright test uses Email for both the signer and the observer, so this case is not covered.
We should cover this at different levels:
- integration/Behat: create a request with an Account signer and an Email observer and confirm that the observer sign request is created with the correct role and notification state;
- PHPUnit: confirm that an observer with Email identification is marked for notification and that the mail listener sends the observer email with the validation link;
- Playwright: confirm the full user flow, including that the external observer receives the email, opens the validation page without an account, and cannot sign.
This will also define the expected journey for an observer that does not have a Nextcloud account.
| if (isOriginalFileDeleted.value || isObserverParticipant(signer)) { | ||
| return false | ||
| } |
There was a problem hiding this comment.
Observers also need a way to receive the notification again.
At the moment canSendReminder() always returns false for observers. In the UI, an observer can only have the message edited or be deleted, but there is no action to send the document link again.
The action does not need to be called Send reminder, because the observer is not waiting to sign. Something like Send notification can be clearer for observers.
The notification should use the observer validation link and include the custom message when it is set.
Add frontend coverage for this action and backend coverage to confirm that sending the notification for an observer uses the validation link.
|
The same rule also needs backend protection.
The API must reject a visible signature element when the Please add a unit test for this validation and an integration/Behat scenario that sends an observer |
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)