Editing Workflows: Owner, User, Approval
SimplyPages editing APIs support direct edits and staged edits.
Core Building Blocks
Editable<T>for module edit contracts.EditModalBuilderfor consistent modal composition.EditModefor owner vs user behavior.AuthWrapperandAuthorizationCheckerfor access control.
Owner Edit Workflow
- Authenticate and authorize opening the edit modal.
- Recheck resource permission and CSRF at save, then validate input.
- Apply edits directly.
- Persist changes.
- Return OOB swaps.
User Edit Workflow (Staged)
- Authenticate and authorize opening the edit modal.
- Recheck resource permission and CSRF at save, then validate input.
- Store change request in approval queue.
- Return pending status UI.
- Owner approves or rejects.
Minimal Handler Shape
public interface ModuleEditHandler<T> {
Component renderEditForm(String moduleId);
Component handleUpdate(String moduleId, Map<String, String> editData, EditMode editMode);
Component handleDelete(String moduleId, EditMode editMode);
}
Request Mechanics
- Edit open:
GET /modules/{id}/edit - Save:
POST /modules/{id}/save?editMode=OWNER_EDIT|USER_EDIT - Delete:
DELETE /modules/{id}/delete?editMode=... - Nested child edit:
GET /modules/{moduleId}/children/{childId}/edit - Nested child save/delete:
POSTorDELETEto the matching child endpoint
Operational Rules
- Treat every edit endpoint as auth-protected.
- Validate server-side before
applyEdits. - Keep audit trail for staged edits.
- Enforce authorization in the controller/service handler, not only by hiding buttons in the UI.
- Escape at render time. Store validated plain text from forms unless the application owns a sanitization pipeline for trusted HTML.
- Supply raw identifiers to framework URL templates; they are encoded once when interpolated. Applications own routing, decoding and business-ID validation.
- Return explicit
403,404, or400responses for blocked permissions, missing records, and invalid positions or IDs.
Never trust a request-provided editMode as authorization. Derive the permitted mode server-side.
Approval queues, persistence, and audit trails are application-owned.