Repository navigation
Open
Labels
apiREST API, OpenAPI spec and MCP server
Milestone
Description
Intent: make the model layer usable without HTML forms, so the API (and cron, imports, the MCP server) get the same behavior and permission checks as the UI. No API yet; the UI must behave exactly as before.
Before starting: #472, #474, #476, #477, #479. Fixed as part of this phase: #473, #475, #478. Decide first: #484.
Steps
- Remove superglobals from model classes: custom fields passed explicitly instead of
$_POSTinBaseObject::hook_postStore()(Saving an object outside its edit form resets its custom fields to 0 #473); dependencies as data inCTask::store(); attendees and invitations as data inCEvent. - Typed results for
load()/store()/delete()(new*OrFail()variants raising not found, forbidden, validation and conflict exceptions), and a real permission error message (A save refused for lack of permission shows an empty error message #478). The existing boolean methods stay. listAllowed(filters, sort, limit, cursor)onBaseObject, built onsetAllowedSQL(), so no list path depends onloadAll().- Stateless
CAppUI::forUser($userId)(no session, prefs loaded, time zone forced to UTC for API use), sharing its loading code with the identity layer'sSessionEstablisher(Identity layer, part 1: foundations and session hardening (Phase 0) #458). w2p_Extensions_Permissionsaccepts an explicit user id everywhere;getEffectivePermissions($userId).- Shared dispatcher for cross-cutting listeners, plus the
$eventfix (Dispatcher passes the event name instead of the event object to later listeners #475). - Extract
TaskService(everything indo_task_aed.php: assignments, dependencies and date shift, dynamics, budgets, departments, notify, move) andProjectService;do_task_aed.phpanddo_project_aed.phpbecome thin adapters. New code goes underWeb2project\insrc/(Proposal: Move classes/w2p to PSR-4 namespaces #470).
Goal: the logged-in crawl and PHPUnit results are unchanged, the services have unit tests, and no *.class.php file reads $_POST/$_GET.
Spec: REST API and MCP server proposal (#471), sections 3, 5.3 and 11.
Metadata
Metadata
Assignees
Labels
apiREST API, OpenAPI spec and MCP server
Activity