No Code Attached Yet bug
avatar Rolli1962
Rolli1962
21 Nov 2022

Steps to reproduce the issue

User with Author-Rights and owner of an article want to preview an older version in edit-mode via versions.

Expected result

Can view the older article

Actual result

Get access right error 403

System information (as much as possible)

J4.2.5 (even fresh installed)

Additional comments

Try this feature with fresh installed Joomla-Versions 4.2.5 and 3.10.11.
With 3.10.11 it is working for the user with Author-Rights. With 4.2.5 not.
In 4.2.5 it is only working, if the user has general edit-rights like user-group editor.

nversions-accesserror

avatar Rolli1962 Rolli1962 - open - 21 Nov 2022
avatar joomla-cms-bot joomla-cms-bot - change - 21 Nov 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Nov 2022
avatar Rolli1962
Rolli1962 - comment - 24 Nov 2022

Would be only a hint I think ...
Found out, if I deactivate the access check in PreviewModel, than a Author is able to watch an older article via versions.
Don't understand, why the access-check is not working for a preview - the access-check for CompareModel is looking quite similar - but there are no access-errors for an author.
Changed (deactivated) lines in
administrator/components/com_contenthistory/src/Model/PreviewModel.php
`

   $user = Factory::getUser();

    // Access check
    //if (!$user->authorise('core.edit', $table->item_id) && !$this->canEdit($table)) {
    //    throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
    //}` 

Hopefully somewhere is reading this with more understanding how that all is working...

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment