← Back to Activities Workflows
5.6.2 ActivitiesController Reference
This stable page summarizes app/plugins/Activities/src/Controller/ActivitiesController.php. Exact signatures belong to the source and generated API documentation.
The controller manages Activity definitions. It is not the member-authorization workflow controller; request, renew, revoke, and retract actions live in AuthorizationsController.
Grid data action
index() renders the page whose Dataverse Grid loads through gridData(). The data action builds an Activities query containing group and assignable-role data, then delegates filtering, sorting, paging, and Turbo Frame rendering to DataverseGridTrait with ActivitiesGridColumns.
The controller authorizes the model actions during initialization. CSV handling remains in the method, but canExportCsv is currently false, so the Activities grid does not offer export.
View action
view() authorizes one activity and loads its permission, group, role lists, and current/pending/previous authorization counts for the detail page.
Add action
add() patches and saves a new activity on POST, then redirects to its detail page. Validation and table rules remain authoritative.
Edit action
edit() loads and authorizes the activity, accepts PATCH/POST/PUT updates, and redirects to the referrer on both request and save paths. It does not currently render a standalone edit form on GET.
Delete action
delete() accepts POST/DELETE, authorizes the activity, prefixes its name with Deleted: , delegates deletion to the table, and redirects to the index.
Approvers list
approversList() is a GET JSON endpoint. It derives organizational context from the requested member, uses Activity::getApproversQuery(), excludes that member, and returns only approver IDs plus branch-prefixed SCA names.
Maintenance rules
- Call
authorizeModel()/entity authorization and apply the Activities table scope before grid/export data. - Treat
approversList()as sensitive, branch-scoped member data; validate both IDs and return only necessary fields. - Keep age, approval-count, role, and permission invariants in models/services/workflow metadata.
- Use plugin grid definitions rather than hand-built column/filter arrays.
- Preserve tenant context and never treat activity IDs as global.