Support

Akeeba Backup for Joomla!

#38558 JSON API delete backup failes with ACL issue

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.2.x
PHP version
8.1.x
Akeeba Backup version
9.5.0

Latest post by SniperSister on Thursday, 16 February 2023 09:39 CST

SniperSister

Hey folks,

I'm using Unite 4 with akeeba 9.x and ran into an issue using the "delete" flag of the remote section of the unite config. The restore process fails at the point where the downloaded backup has to be deleted on the server.

After some debugging I traced the issue down to the actual task handler for the "delete" task in Akeeba 9, it calls the delete() method of the admin statistics model, which triggers a "canDelete" check that is inherited from the default Joomla admin model - and that check fails, I assume because the JSON API works with a "guest" sessionΒ  which is not allowed to delete rows.

Can you confirm this finding? Or is it just me being stupid?

Cheers,

David

nicholas
Akeeba Staff
Manager

No, you are right. That's the downside of the current JSON API implementation, it comes without logging in the user.

I will add a workaround for the delete API method.

The ultimate goal is to use the Joomla API application for Akeeba Backup's API. However, this is still not quite possible as it only supports Super Users, whereas the most sensible use case for backups would be to create a very limited backend user group role which has only access to Akeeba Backup. Ideally, that user group would only be granted the subset of privileges required for the remote backup operations one would want, for example just the backup privilege to run backups. This way even if the token leaked it would be both easy to reset and the effects would be relatively anodyne (to the extent that someone running continuously backups on the site is anodyne). I am only mentioning this so you have an idea what is in the back of my mind, pending support from Joomla itself β€” and why I am so invested in the Joomla API application πŸ™‚

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

SniperSister

Awesome, can you let me know once you have a dev build available? Will happily test it :)

Regarding your idea: makes perfect sense! What's your current blocker with API application and non-superadmin users? I have a working example of non-su users using the API, so in general it should be possible?

nicholas
Akeeba Staff
Manager

> Awesome, can you let me know once you have a dev build available? Will happily test it :)

Yup. Here you go: https://www.akeeba.com/download/akeebabackuppro-dev/9-5-1-dev202302161317-rev9602cd0.html

> What's your current blocker with API application and non-superadmin users?

The current implementation of the core API components is restricted to Super Users. For this reason, the API token plugin is limited to Super Users as per the discussion we had in 2020 when I contributed it to the core. There is the provision to add a user group multi-select field named allowedUserGroups in its XML file to allow non-Super Users to access it.

Otherwise, I would have to fork this plugin, which is in itself a fork of my FOF User Token plugin from 2018. To quote Lethal Weapon, β€œI am too old for this s…t” .

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

SniperSister

I can confirm that the issue is solved in the dev release, thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!