Review main Merged

69304[BUGFIX] Prevent disabling and deleting of current user

Oli Bartsch CR +2 V +2 Normal +54 −3 updated 05/28/21, 18:16

Commit message

Both, the recordlist as well as the backend user module
already check the currently logged in user when evaluating
the available record actions, e.g. disable or delete.

Since disabling / deleting the currently logged in user
will result in a completely broken state, which can only
be fixed with direct database access, those checks
are now also implemented in FormEngine and the
ContextMenu. Furthermore, a new DisplayCond is added
to hide the "disable" field in the current user record.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Jochen Roth +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Jochen Roth +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1316

  1. Oli Bartsch uploaded patch set 1 05/27/21, 20:54

  2. core-ci voted on patch set 1 V +1 05/27/21, 21:07 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11923

  3. Andreas Kienast commented on patch set 1 05/27/21, 21:24

    Talking about FormEngine: I can still disable my own account by toggling the `disable` field. Is it easily possible to adjust the TCA and to remove that field it it's my own user record?
  4. Andreas Kienast commented on patch set 1 05/27/21, 21:25

    ... the same applies to the `admin` field
  5. Oli Bartsch commented on patch set 1 05/27/21, 21:59

    Reply

    Ye correct. I'm currently working on an implementation for the DataHandler.
  6. Oli Bartsch commented on patch set 1 V -1 05/27/21, 22:00

    This must also be handled within DataHandler.
  7. Oli Bartsch uploaded patch set 2 05/27/21, 23:21

  8. Oli Bartsch commented on patch set 2 05/27/21, 23:24

    Reply

    Not sure about DataHandler, since this will also prevent such actions on CLI, which is obviously without any backend context and would therefore not lead to any exceptions. For now, I added a displayCond to hide the "disabled" field in FormEngine in case the record is the currently logged in backend user.
  9. core-ci voted on patch set 2 V +1 05/27/21, 23:29 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11931

  10. Oli Bartsch updated the commit message in patch set 3 05/28/21, 08:44

  11. Oli Bartsch commented on patch set 3 05/28/21, 08:46

    This change is ready for review. Note: We decided to just fix the interface in this patch as adjusting DataHandler may cause unexpected behaviour in some use cases.
  12. core-ci voted on patch set 3 V +1 05/28/21, 08:55 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11939

  13. Christian Kuhn voted on patch set 3 V +1 CR +1 05/28/21, 10:44

  14. Jochen Roth voted on patch set 3 V +1 CR +1 05/28/21, 10:46

  15. Anja Leichsenring voted on patch set 3 V +2 CR +2 05/28/21, 18:16

  16. Anja Leichsenring merged patch set 4 05/28/21, 18:16