Review main Merged

48998[BUGFIX] Hide edit icon in list view

Nicole Hummel CR +2 V +2 Easy +7 −6 updated 10/13/16, 14:57

Commit message

If a record is not editable for a user, the edit icon in the record
list should be hidden.

This patch changes following behavior:

* all fields of a record are fetched to do further access checks
* a check if the user is able to edit that record is included
* space icon for the hidden icon is cleaned up

Review

  • Code review CR +2
    • Frank Nägler +2
    • Benni Mack +1
  • Verified V +2
    • Frank Nägler +2
    • Benni Mack +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1721

  1. Nicole Hummel uploaded patch set 1 07/16/16, 16:00

  2. TYPO3com voted on patch set 1 V -1 07/16/16, 16:15 Completed build in 15m 10s on Sat, 16 Jul, 06:15 PM Test Summary: 19117 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-997

  3. Sascha Egerer commented on patch set 1 CR -1 07/21/16, 20:29

    DatabaseRecordList.php:1544

    Don't understand why $hiddenField is moved here. That's a string containing the fieldname, right? And it was above to ensure that the variable is set because it is used to access the array ` $GLOBALS['TCA'][$table]['columns'][$hiddenField]` Or am i wrong?
  4. Nicole Hummel commented on patch set 1 07/21/16, 20:35

    DatabaseRecordList.php:1544 Reply

    This is to ensure there is either the hidden icon or an empty icon to align all buttons available. (Imagine there is one record which the user doesn't have access to but all others in the table are editable)
  5. TYPO3com voted on patch set 1 V +1 07/21/16, 21:14 Completed build in 5h 29m 10s on Thu, 21 Jul, 11:14 PM Test Summary: 19290 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-997

  6. Sascha Egerer commented on patch set 1 07/27/16, 10:41

    DatabaseRecordList.php:1544 Reply

    But $hiddenField must be set here because you'll never come to this line if it isn't set. So this check is superflous, right?
  7. Nicole Hummel uploaded patch set 2 08/29/16, 09:53

  8. Nicole Hummel commented on patch set 1 08/29/16, 09:53

    DatabaseRecordList.php:1544 Reply

    Done
  9. TYPO3com voted on patch set 2 V +1 08/29/16, 09:55 Completed build in 02m 47s on Mon, 29 Aug, 11:55 AM Test Summary: 18646 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2386

  10. Markus Klein updated the commit message in patch set 3 09/13/16, 17:27

  11. Markus Klein commented on patch set 3 09/13/16, 17:29

    I'm not sure about the impact of loading the full rows for the records. Is there any way to achieve the necessary check directly in SQL somehow?
  12. TYPO3com voted on patch set 3 V +1 09/13/16, 17:30 Completed build in 03m 46s on Tue, 13 Sep, 07:30 PM Test Summary: 18511 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3071

  13. Benni Mack commented on patch set 3 CR +1 V +1 10/08/16, 19:47

    i think the impact of fetching the full rows in SQL is not a big one (no relations, just a plain SQL row to array) and the patch looks and works just fine. We're not talking about 30.000 records with lots of MM tables here...
  14. Christian Kuhn commented on patch set 3 10/09/16, 12:53

    does that work if a user has no edit permissions on a base record but has edit permissions on an overlayed localized record?
  15. Frank Nägler commented on patch set 3 10/12/16, 15:29

    DatabaseRecordList.php:1539

    imho remove $hiddenField is not safe, the variable could be null and is used in the next condition.
  16. Nicole Hummel commented on patch set 3 10/12/16, 15:36

    DatabaseRecordList.php:1539 Reply

    IMHO if $hiddenfield is NULL empty($GLOBALS['TCA'][$table]['columns'][$hiddenField]) is true and its not used furthermore
  17. Nicole Hummel commented on patch set 3 10/12/16, 15:36

    @Christian: How can I configure a user to test your case? Sorry, I didn't got this from reading the comment.
  18. Frank Nägler commented on patch set 3 10/12/16, 15:43

    DatabaseRecordList.php:1539 Reply

    corrext, sry, my mistake!
  19. Frank Nägler voted on patch set 3 CR +2 V +2 10/13/16, 14:56

  20. Frank Nägler commented on patch set 3 10/13/16, 14:57

    verified it works, also the case mentioned by lolli
  21. Gerrit merged patch set 3 10/13/16, 14:57