Issue Bug Closed

#106235mod.web_list.deniedNewTables has no effect

Michael Perlbach 02/22/25, 16:02 updated 02/23/25, 14:54

Description

I want to prevent a user from creating new content on a page – after trying a lot of things I found this:
https://docs.typo3.org/m/typo3/reference-typoscript/13.4/en-us/PageTsconfig/Mod/WebList.html#hide-create-new-record-links-in-tables-sys-category-and-tt-content

So I set this in the page tsconfig of the page where I want to prevent users from creating new content.

mod.web_list {
deniedNewTables = sys_category, tt_content
}

However, this setting does not have any effect. It is still possible for a non-admin user to create new content elements. Why is that so?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 10

  1. Michael Perlbach commented <span data-processor="relativetime" data-value="2025-02-22T16:18:19+00:00" > 02/22/25, 16:18 </span>

    Ah, I see. It’s only for the “list” module.

    Well, my users will not work with the list module they work in “Web”->“Page”. Why is there not an appropriate possibility for the web_layout module?
    It’s simply about not showing the “Create new content” buttons on a page level for a certain group of users. And it seems to be impossible. Quite frustrating.

  2. Michael Perlbach commented <span data-processor="relativetime" data-value="2025-02-22T16:29:54+00:00" > 02/22/25, 16:29 </span>

    And then there is the additional option “noCreateRecordsLink” for the module “web_layout”
    https://docs.typo3.org/m/typo3/reference-typoscript/13.4/en-us/PageTsconfig/Mod/WebLayout.html#nocreaterecordslink

    As it is described here: “If set, the link in the bottom of the page, “Create new record”, is hidden.”

    Firstly: there is no “Create new record” in the bottom of the page. For each page I have “Create new content” above and below each content element.

    Secondly, and no surprise here: It is also not working.

  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2025-02-22T16:53:08+00:00" > 02/22/25, 16:53 </span>

    If I am not wrong you can do that using the “System” > “Permissions” Module – you can disable the permission #2 (Edit content: Change/Add/Delete/Move content) for the user or usergroup on that page.

    on page TSConfig the option is under TCEMain.permissions

    https://docs.typo3.org/m/typo3/reference-typoscript/13.4/en-us/PageTsconfig/TceMain.html#pagetcemain-permissions-user-group

    About the option “noCreateRecordsLink” you found, I’ll check it, thank you for your findings

  4. Garvin Hicking commented and changed category status New Needs Feedback <span data-processor="relativetime" data-value="2025-02-22T18:14:21+00:00" > 02/22/25, 18:14 </span>

    Also I recommend EXT:content_defender.

  5. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-02-22T19:05:03+00:00" > 02/22/25, 19:05 </span>

    About “noCreateRecordsLink”: This only applies to NON tt_content records. Maybe you want to create a PR on the documentation page to add that to the documentation.

            if ($table !== 'tt_content' && !($this->modTSconfig['noCreateRecordsLink'] ?? false) && $this->editLockPermissions()) {
  6. Michael Perlbach commented <span data-processor="relativetime" data-value="2025-02-22T19:46:59+00:00" > 02/22/25, 19:46 </span>

    “If I am not wrong you can do that using the “System” > “Permissions” Module – you can disable the permission #2 (Edit content: Change/Add/Delete/Move content) for the user or usergroup on that page.”

    I will look it up. But I fear that is not what I want. I want users just to edit one single content element on a page and not having the possibility to create new content elements on that page. As I learned already the permission “edit” in the TYPO3 permissions encompasses edit AND create. So when I disable “create” I also disable “edit”.
    This is because there is no clean CRUD implementation.

    But I look it up – maybe I am wrong.

  7. Chris Müller commented <span data-processor="relativetime" data-value="2025-02-22T19:56:13+00:00" > 02/22/25, 19:56 </span>

    Your use case (just edit only one content element on a page (not others), and do not allow to create new content elements on a page) consider using this PSR-14 event:
    https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/Events/Events/Backend/ModifyEditFormUserAccessEvent.html
    You can also get the current user with $GLOBALS[‘BE_USER’].

    Disclaimer: not used this event in the past, just looked up the docs. Maybe it does not fit, maybe it fits your needs.

  8. Chris Müller commented <span data-processor="relativetime" data-value="2025-02-22T19:58:26+00:00" > 02/22/25, 19:58 </span>

    Another possibility would be to move that specific content element to a dedicated page, where those special users have only edit permissions. And use “Insert records” content element to show it on the “real” page.

  9. Michael Perlbach commented <span data-processor="relativetime" data-value="2025-02-23T04:05:06+00:00" > 02/23/25, 04:05 </span>

    Thanks – and sorry, but I will not even try Chris Müller’s second solution – it reads overly clumsy and complicated. I have to implement a site with > 30 users – and there
    are more sites of this type on the way. It has to work fast, easy and consistent.

    As for Chris Müller’s first solution – I am using this eventlistener already. And I am able to prevent a user from editing content and even create new content.
    However, to my surprise I discovered that the eventlistner’s method “getCommand()” only returns “new” and “edit”. So I am not able to catch “delete” and prevent a user from deleting other content. Also “show” is missing here. So once again: Only a partial CRUD implementation.

    Then I try user tsconfig. User TSconfig, as far as I see it, does not provide any conditions for page ids. Something like

    [traverse(page, "uid") == 2]
    options.disableDelete.tt_content = 1
    [END]

    in a user tsconfig is also not working. Either you disable deleting for a user completely or not.
    Also, “options.disableDelete.tt_content” is not available in PAGE Tsconfig.

    If someone thinks that my use case is too special – I don’t think so. Implementing a consistent and fine grained permission system is the key to flawlessly – and userfriendly!- working multiuser installations (what I am aiming for).

    I leave it here for now. Issue can be closed as presumably no working solution is currently possible. I might return to the subject on Slack.

  10. Chris Müller commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2025-02-23T14:54:14+00:00" > 02/23/25, 14:54 </span>

    Closed on author’s request.