Issue Bug Closed

#105567Frontend preview not working on restricted pages for normal editors

Chris no-lastname-given 11/11/24, 11:10 updated 12/02/25, 14:32

Description

Prerequisite:
All pages in the page tree are only allowed to access with a valid frontend user login.

How to reproduce
  • Log into TYPO3 with editor rights. The editor should have access to selected pages only!
  • Select a page in the page tree and click on preview
  • The preview will open
  • Navigate to to a page which the backend user has edit rights -> preview is working
  • Now navigate to a page which the editor has no rights to edit in TYPO3 but the current logged in frontend user is allowed to see
  • You will get an error 403

Maybe #96658 is related?

Tested with TYPO3 v12.4.22

Reviews 3

History 1216

  1. Garvin Hicking commented and changed category status New Needs Feedback <span data-processor="relativetime" data-value="2024-11-11T13:49:21+00:00" > 11/11/24, 13:49 </span>

    I stumble across “but the current logged in frontend user” – at which point do you log into the frontend?

    Executing the preview on a specific page simulates a FE user, but your editor and fe user are not connected. If however you are logged in the FE and BE at the same time and then simulate, it could affect your session.

    Have you tried this in a way where you are not logged into the frontend seperately, only with a backend login and the preview functionality?

  2. Chris no-lastname-given commented <span data-processor="relativetime" data-value="2024-11-11T14:09:41+00:00" > 11/11/24, 14:09 </span>

    Garvin Hicking wrote in #note-2:
    > I stumble across “but the current logged in frontend user” – at which point do you log into the frontend?

    The website is an Intranet, so all pages are restricted to the access of frontend users only. The automatic login is done with Kerberos and the extension “causal/ig_ldap_sso_auth” (https://github.com/xperseguers/t3ext-ig_ldap_sso_auth/)

    > Executing the preview on a specific page simulates a FE user, but your editor and fe user are not connected. If however you are logged in the FE and BE at the same time and then simulate, it could affect your session.

    Yes, I am logged in as backend AND frontend user.

    > Have you tried this in a way where you are not logged into the frontend seperately, only with a backend login and the preview functionality?

    I have now tested without a logged in frontend user and I get the same error 403, if I navigate to a page, which is not editable for the backend user. For this scenario, I would say, the error is correct, because I am not logged in as a frontend user and so I should not be able to see the page.

  3. Chris no-lastname-given commented <span data-processor="relativetime" data-value="2024-11-11T14:18:25+00:00" > 11/11/24, 14:18 </span>

    Thinking a little more about your comment @ghi, I guess, that the frontend preview is granted to the pages of the current backend user only. The rights of the current frontend user are ignored. Maybe that’s the issue? Shouldn’t both rights (frontend and backend) be merged?

  4. Garvin Hicking commented <span data-processor="relativetime" data-value="2024-11-11T15:05:49+00:00" > 11/11/24, 15:05 </span>

    I must admit I haven’t checked the code on this to be sure, but from my understanding, the BE user preview replaces a frontend user login by “logging in” with a fake frontend user that gets the permissions granted to view the current page. If you seperately browse to another page, your “actual” frontend user takes over, and then you only see what that FE user can see.

    There should be a URL variable like “ADMCMD_simUser=2” that toggles that behavior; and that is only viable for those pages that are called with that variable. Normally the variable should be transferred over to all URLs when you navigate the page in the preview window. Does that happen for you?

  5. Chris no-lastname-given commented <span data-processor="relativetime" data-value="2024-11-11T15:46:28+00:00" > 11/11/24, 15:46 </span>

    Garvin Hicking wrote in #note-5:
    > I must admit I haven’t checked the code on this to be sure, but from my understanding, the BE user preview replaces a frontend user login by “logging in” with a fake frontend user that gets the permissions granted to view the current page. If you seperately browse to another page, your “actual” frontend user takes over, and then you only see what that FE user can see.

    That is exactly, what I would expect too.

    > There should be a URL variable like “ADMCMD_simUser=2” that toggles that behavior; and that is only viable for those pages that are called with that variable. Normally the variable should be transferred over to all URLs when you navigate the page in the preview window. Does that happen for you?

    Yes, in my navigation, the parameter “?ADMCMD_simUser=1” is added for the preview of a backend user. It is always “?ADMCMD_simUser=1” regardless which user is logged in (not the backend user id) and it is added to all pages. Manually removing the parameter from the url does not stop throwing the 403 error for the pages, which are not allowed by the backend user.

  6. Chris no-lastname-given commented <span data-processor="relativetime" data-value="2025-03-10T09:09:44+00:00" > 03/10/25, 09:09 </span>

    @speters What additional information can I provide to the section “How to reproduce” and the comments in this issue?

  7. Sybille Peters commented <span data-processor="relativetime" data-value="2025-03-10T09:15:43+00:00" > 03/10/25, 09:15 </span>

    I am sorry, I was looking at several issues and must have mixed something up. There are steps to reproduce in the description. Please ignore my comment. I will remove it if possible

  8. Gerrit Code Review pushed patch set 2 for main to change 88762 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2025-03-27T11:32:03+00:00" > 03/27/25, 11:32 </span>

  9. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-03-27T12:40:08+00:00" > 03/27/25, 12:40 </span>

    Applied in changeset commit:7e34ac73d0df9d88ee1fa9a8b75dbcdb272c2873.