From 2b5fe7f2762d9c72083e90d9809e43727e0c862c Mon Sep 17 00:00:00 2001 From: Jim Safley Date: Mon, 2 Feb 2026 17:01:51 -0500 Subject: [PATCH] Add API resource Requires the index_acl_resource route option in core to protect access. --- ActivityLogPlugin.php | 11 +++++++++++ models/Api/ActivityLogEvent.php | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 models/Api/ActivityLogEvent.php diff --git a/ActivityLogPlugin.php b/ActivityLogPlugin.php index 6c9d230..3e828da 100644 --- a/ActivityLogPlugin.php +++ b/ActivityLogPlugin.php @@ -24,6 +24,7 @@ class ActivityLogPlugin extends Omeka_Plugin_AbstractPlugin protected $_filters = [ 'admin_navigation_main', + 'api_resources', 'activity_log_event_messages', ]; @@ -201,6 +202,16 @@ public function filterAdminNavigationMain($nav) return $nav; } + public function filterApiResources($apiResources) + { + $apiResources['activity_log_events'] = [ + 'record_type' => 'ActivityLogEvent', + 'actions' => ['get', 'index'], + 'index_acl_resource' => 'ActivityLog_Events', + ]; + return $apiResources; + } + public function filterActivityLogEventMessages($messages, $args) { $event = $args['event']; diff --git a/models/Api/ActivityLogEvent.php b/models/Api/ActivityLogEvent.php new file mode 100644 index 0000000..4831a54 --- /dev/null +++ b/models/Api/ActivityLogEvent.php @@ -0,0 +1,13 @@ +