$args Raw tool arguments (envelope included). * @param array $auth The $auth the executor received. * @param array $intent JSON-serializable intent understood by the adapter. */ public function write(string $type, int $objectId, array $args, array $auth, array $intent, string $event): mixed { if (!$this->mayWrite($type)) { return Engine::error('forbidden', __('This module cannot change that kind of item.', 'llamly'), 403); } return Toolkit::run($type, $this->tool, $objectId, $args, $auth, $intent, $event); } /** Revision hash of an item, the value expected_hash must carry. Null for an unknown type. */ public function hash(string $type, int $objectId): ?string { return $this->mayWrite($type) ? Toolkit::hashOf($type, $objectId) : null; } private function mayWrite(string $type): bool { $owner = ModuleRegistry::ownerOfType($type); if ($owner !== null) { return $owner['id'] === $this->moduleId && $owner['active']; } $adapter = Engine::adapter($type); return $adapter !== null && strpos(get_class($adapter), 'Llamly\\Free\\') === 0; } }