Review main Merged

61099[TASK] Make Permission class a BitSet instead of Enumeration

Alexander Schnitzler CR +2 V +2 Normal +146 −97 updated 09/14/20, 20:19

Commit message

The Permission class unnecessarily had been implemented as
Enumeration although the features of the Enumeration base
class hadn't been used.

As the Permission class only handles boolean flags, it is
now implemented as bit set, which improves the performance
in comparison to Enumeration classes.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
    • Benni Mack +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Christian Kuhn +1
    • Benni Mack +1
    • TYPO3com +1 CI

Issues 1

Files 19

Review log 3754

Show 1929 earlier messages
  1. Alexander Schnitzler uploaded patch set 1 06/19/19, 18:23

  2. TYPO3com voted on patch set 1 V +1 06/19/19, 18:34 Completed build in 11m 03s on Wed, 19 Jun, 08:34 PM Test Summary: 46448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34457

  3. Alexander Schnitzler uploaded patch set 2 06/21/19, 18:23

  4. TYPO3com voted on patch set 2 V +1 06/21/19, 18:36 Completed build in 13m 14s on Fri, 21 Jun, 08:36 PM Test Summary: 46478 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34502

  5. Alexander Schnitzler uploaded patch set 3 10/14/19, 18:12

  6. TYPO3com voted on patch set 3 V -1 10/14/19, 18:12 Completed build in 20s on Mon, 14 Oct, 06:12 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37322

  7. Alexander Schnitzler uploaded patch set 4 10/14/19, 18:19

  8. TYPO3com voted on patch set 4 V +1 10/14/19, 18:30 Completed build in 10m 35s on Mon, 14 Oct, 06:30 PM Test Summary: 47982 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37323

  9. Alexander Schnitzler rebased onto patch set 5 10/21/19, 10:43

  10. Alexander Schnitzler uploaded patch set 6 10/21/19, 10:58

  11. TYPO3com voted on patch set 5 V +1 10/21/19, 11:01 Completed build in 13m 36s on Mon, 21 Oct, 11:01 AM Test Summary: 48010 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37407

  12. TYPO3com voted on patch set 6 V -1 10/21/19, 11:13 Completed build in 15m 02s on Mon, 21 Oct, 11:13 AM Test Summary: 1 of 48369 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37409

  13. TYPO3com voted on patch set 6 V +1 10/21/19, 11:46 Completed build in 1h 03m 46s on Mon, 21 Oct, 11:46 AM Test Summary: 48010 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37409

  14. Alexander Schnitzler commented on patch set 6 10/22/19, 08:07

    This change is ready for review.
  15. Alexander Schnitzler commented on patch set 6 10/31/19, 10:02

    ping
  16. Georg Ringer voted on patch set 6 V +1 CR +1 11/01/19, 19:08

  17. Benni Mack commented on patch set 6 CR +1 11/04/19, 15:21

    will give it a test-run
  18. Oliver Hader commented on patch set 6 CR -1 11/04/19, 15:39

    DataHandler.php:6105

    Why? Isn't that the scope of this change?!

    DataHandler.php:6109

    Not clear from this point of view what actually should happen... Probably might be $permission->oneOf([a,b,c]) or $permission->allOf([a,b,c] to be specific...

    Permission.php:22

    Previously this was used for direct comparison (logic resided in according controllers). Now if evaluation is shifted to according object, probably we should ensure proper namespaces or class names are used - "Permission" is too broad... either Backend/Page/Permission or PagePermission

    Permission.php:75

    self - the class is final...

    DatabaseRecordList.php:364

    Breaking change... and if doing this, would it be possible to remove it from public context?
  19. Alexander Schnitzler uploaded patch set 7 11/04/19, 16:49

  20. Alexander Schnitzler commented on patch set 7 11/04/19, 16:52

    DataHandler.php:6105 Reply

    Yep, the scope is to get rid of direct comparisons and to achieve this I created another method.

    DataHandler.php:6109 Reply

    > $perms & Permission::PAGE_EDIT + Permission::PAGE_DELETE + Permission::CONTENT_EDIT actually checked whether one of those permissions were granted and not all of them. My initial change changed that logic, so I refactored this part to make it more verbose.
  21. Alexander Schnitzler commented on patch set 7 11/04/19, 16:53

    Permission.php:22 Reply

    I am fine with putting this class in any namespace you like. Where do you want to put it?

    DatabaseRecordList.php:364 Reply

    Well, I can't decide if this is breaking. I'll ask Benni.
  22. TYPO3com voted on patch set 7 V -1 11/04/19, 17:01 Completed build in 11m 59s on Mon, 4 Nov, 05:01 PM Test Summary: 47890 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37990

  23. TYPO3com voted on patch set 7 V +1 11/04/19, 17:12 Completed build in 35m 10s on Mon, 4 Nov, 05:12 PM Test Summary: 48123 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37990

  24. Oliver Hader commented on patch set 7 11/07/19, 13:38

    > Patch Set 7: > > (2 comments)

    Permission.php:22 Reply

    Look above... it's not a requirement from my side, more a suggestion to make it more explicit what it actually does. If it stays like this, I personally could live with it...

    DatabaseRecordList.php:364 Reply

    Hm... seems this class is marked as "@internal"... thus, it wouldn't be breaking... Anyway, avoiding public property assignment still would be nice...
  25. Benni Mack commented on patch set 7 11/07/19, 14:40

    Permission.php:22 Reply Unresolved

    Had a brief look over this change recently as well, and the one thing I'd really like to have is to name it "PagePermissions" as this concept of PAGE_SHOW/EDIT/EDIT_CONTENT etc is 100% only useful for pages, not for anything else. In this case, we could just deprecate this class and actually use this a new class (PagePermissions) extending from BitSet and we're safe.

    DatabaseRecordList.php:364 Reply

    if the class is marked as internal, it's not breaking. Still, how about we introduce a new protected property called `$pagePermissions` here?
  26. Benni Mack uploaded patch set 8 12/27/19, 21:39

  27. TYPO3com voted on patch set 8 V +1 12/27/19, 22:42 Completed build in 37m 22s on Fri, 27 Dec, 10:42 PM Test Summary: 69126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39626

  28. Alexander Schnitzler commented on patch set 8 12/28/19, 14:06

    Permission.php:75 Reply

    Ack

    DatabaseRecordList.php:364 Reply Unresolved

    I'm fine with that. Do we mark the current property as deprecated? Not for the public but for the internal use?
  29. Benni Mack uploaded patch set 9 12/31/19, 13:06

  1. TYPO3com voted on patch set 9 V -1 12/31/19, 13:15 Completed build in 08m 42s on Tue, 31 Dec, 01:15 PM Test Summary: 69134 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39681

  2. TYPO3com voted on patch set 9 V +1 12/31/19, 13:43 Completed build in 45m 30s on Tue, 31 Dec, 01:43 PM Test Summary: 69134 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39681

  3. Benni Mack uploaded patch set 10 01/30/20, 12:14

  4. TYPO3com voted on patch set 10 V +1 01/30/20, 12:30 Completed build in 15m 26s on Thu, 30 Jan, 12:30 PM Test Summary: 70840 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40353

  5. Alexander Schnitzler commented on patch set 10 03/01/20, 11:16

    Hi, what do we do with this patch? Has been rebased some times and got no votes. Do we want this in the core? If not, I will abandon this to clean up my personal patch stack.
  6. Alexander Schnitzler commented on patch set 10 03/28/20, 09:54

    > Patch Set 10: > > Hi, what do we do with this patch? Has been rebased some times and got no votes. Do we want this in the core? If not, I will abandon this to clean up my personal patch stack. Hey folks, can I please have feedback here?
  7. Tymoteusz Motylewski commented on patch set 10 03/28/20, 21:08

    Hi I would like to have it in, however right now Im deep in some other topics (page tree)
  8. Benni Mack commented on patch set 10 03/30/20, 15:32

    I think this is much more performant than Enum. I've already rebased the patch multiple times and I'd still like to see it added.
  9. Benni Mack uploaded patch set 11 04/17/20, 23:16

  10. TYPO3com voted on patch set 11 V +1 04/17/20, 23:43 Completed build in 21m 41s on Fri, 17 Apr, 11:43 PM Test Summary: 73627 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2765

  11. Georg Ringer voted on patch set 11 V +1 CR +1 04/18/20, 17:55

  12. Alexander Schnitzler commented on patch set 11 08/13/20, 15:10

    ping
  13. Daniel Goerz uploaded patch set 12 08/22/20, 11:57

  14. Daniel Goerz voted on patch set 12 V +1 CR +1 08/22/20, 11:59

  15. TYPO3com voted on patch set 12 V -1 08/22/20, 12:10 Completed build in 12m 49s on Sat, 22 Aug, 12:10 PM Test Summary: 62741 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4847

  16. TYPO3com voted on patch set 12 V +1 08/22/20, 12:34 Completed build in 49m 22s on Sat, 22 Aug, 12:34 PM Test Summary: 73074 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4847

  17. Benni Mack uploaded patch set 13 09/02/20, 10:32

  18. TYPO3com voted on patch set 13 V +1 09/02/20, 10:44 Completed build in 11m 46s on Wed, 2 Sep, 10:43 AM Test Summary: 73164 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5131

  19. Benni Mack voted on patch set 13 CR +1 09/02/20, 15:33

  20. Oli Bartsch voted on patch set 13 CR +1 09/03/20, 10:29

  21. Benni Mack voted on patch set 13 V +1 09/03/20, 14:27

  22. Christian Kuhn voted on patch set 13 V +1 CR +1 09/03/20, 18:59

  23. Anja Leichsenring voted on patch set 13 V +2 CR +2 09/03/20, 18:59

  24. Anja Leichsenring merged patch set 14 09/03/20, 18:59

  25. Daniel Windloff commented on patch set 14 09/14/20, 20:19

    DatabaseRecordList.php:2101 Unresolved