Php 从自定义挂钩Directus更新另一个集合
各位同事下午好 我需要能够从自定义挂钩更新另一个集合, 如果我使用ItemsService或TableGatewayFactory,它将使用容器的acl,则会发生以下情况。。。在这种情况下,用户将从客户角色,但这没有权限编辑订单,我想保持这种方式 如果我必须使用其他用户的令牌或任何其他替代项更新项目,这并不重要 提前谢谢Php 从自定义挂钩Directus更新另一个集合,php,api,directus,Php,Api,Directus,各位同事下午好 我需要能够从自定义挂钩更新另一个集合, 如果我使用ItemsService或TableGatewayFactory,它将使用容器的acl,则会发生以下情况。。。在这种情况下,用户将从客户角色,但这没有权限编辑订单,我想保持这种方式 如果我必须使用其他用户的令牌或任何其他替代项更新项目,这并不重要 提前谢谢 'item.update.transactionlog' => function ($data) { <br> $container = Applica
'item.update.transactionlog' => function ($data) { <br>
$container = Application::getInstance()->getContainer(); <br>
$itemsService = new \Directus\Services\ItemsService($container);<br>
$acl = $container->get('acl');<br>
$params = [];<br>
$orden = ['status' => 'paid'];<br>
$orderUpdate = $itemsService->update('orders', $data['orderid'], $orden, $params);<br>
}
'item.update.transactionlog'=>函数($data){
$container=Application::getInstance()->getContainer();
$itemsService=new\Directus\Services\itemsService($container);
$acl=$container->get('acl');
$params=[];
$orden=[“状态”=>“已支付”];
$orderUpdate=$itemsService->update('orders',$data['orderid'],$orden,$params);
}