API: no permissions after creating a node

developr

Active member
Affected version
2.1
Hi there,

when I create a node via the endpoint /nodes/ the node is not visible in the frontend and I have no permission to update or delete these node.

You are only able to update or delete via API after a forums rebuild.
Subforums are only visible after editing some forum manually.
 
This is a potentially tricky issue to resolve automatically. This happens because when a node is added, a permission rebuild is required and this is triggered via a separate job. As the API does not support blocking manual jobs (like the ACP), this should get inserted as a background job. Simply browsing the forum should trigger the rebuild. It shouldn't require explicitly editing to trigger a rebuild, though I haven't investigated too deeply yet.

The permission rebuild is triggered via a separate job as it could take a significant amount of time and may have to be broken up into separate steps. As such, this might need to be something we note in the API docs and then give API clients tools to be able to trigger the job manually. Saying that, we may be able to trigger the job with a shorter run time than normal and, if it runs quickly, that may be sufficient for most cases.
 
This is a potentially tricky issue to resolve automatically. This happens because when a node is added, a permission rebuild is required and this is triggered via a separate job. As the API does not support blocking manual jobs (like the ACP), this should get inserted as a background job. Simply browsing the forum should trigger the rebuild. It shouldn't require explicitly editing to trigger a rebuild, though I haven't investigated too deeply yet.
On a related note, are there any rebuilds/jobs run after a user is updated via the API - specifically when secondary user groups are changed? I have noticed (though only in Safari) the site will sometimes not load for a few minutes after a user is updated. The forum works fine for everyone else though.
 
This is a potentially tricky issue to resolve automatically.
I had hoped that the bug would be fixed with version 2.2. From my point of view, it makes no difference whether a node is created or updated via the backend or the api. in both cases you want to use the forum immediately and edit or delete it if necessary (like in backend).

So from a remote system or app it is not possible to manage the nodes.
 
Last edited:
Top Bottom