Review main Abandoned

63405[FEATURE] Possibility to mark a dashboard widget as admin only

Richard Haeser CR 0 V 0 Normal +43 −13 updated 03/25/20, 13:20

Commit message

By providing a method isAdminOnly in your widget object, you
can now make sure a widget is only shown to admin users or not.

By default a widget is available for all users. When you want to
make it admin only and you extend the AbstractWidget, you can just
set the property adminOnly to true.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 7

Review log 2633

Show 78 earlier messages
  1. Richard Haeser uploaded patch set 1 02/24/20, 13:51

  2. Daniel Siepmann commented on patch set 1 02/24/20, 14:03

    WidgetRegistry.php:76

    Personally I don't like that we are creating instances in order to check a static information. Not sure whether there would be use cases to determine the adminOnly dynamically. We could add that one the same way as the identifier? That would shift that definition from code to `Services.*` file.
  3. Daniel Siepmann commented on patch set 1 02/24/20, 14:04

    WidgetRegistry.php:76 Reply

    Another way would be to define an Interface and check whether the widget class implements the interface? Would be way less code, a single empty interface, and a single check here.
  4. Simon Gilli commented on patch set 1 02/24/20, 14:05

    AbstractWidget.php:132

    Shouldn't that be part of the WidgetInterface too?
  5. Richard Haeser commented on patch set 1 02/24/20, 14:08

    WidgetRegistry.php:76 Reply

    That might indeed be a good option!
  6. Claus Due commented on patch set 1 02/24/20, 14:12

    WidgetRegistry.php:76 Reply

    I am 100% in agreement with the idea to use a "signaling interface" (btw, these can also be checked with "is_a()" without instancing).
  7. TYPO3com voted on patch set 1 V -1 02/24/20, 14:17 Completed build in 22m 15s on Mon, 24 Feb, 02:17 PM Test Summary: 50 of 72070 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-627

  8. Daniel Siepmann uploaded patch set 2 02/24/20, 14:31

  1. TYPO3com voted on patch set 2 V -1 02/24/20, 14:32 Completed build in 26s on Mon, 24 Feb, 02:32 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-630

  2. Daniel Siepmann uploaded patch set 3 02/24/20, 14:33

  3. TYPO3com voted on patch set 3 V -1 02/24/20, 14:34 Completed build in 22s on Mon, 24 Feb, 02:34 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-631

  4. Daniel Siepmann commented on patch set 3 02/24/20, 14:35

    WidgetRegistry.php:76 Reply

    Using Claus approach with "is_a", which is easy to understand 👍

    AbstractWidget.php:132 Reply

    No, as it was optional and checked in the code. But now another approach is taken anyway.
  5. Daniel Siepmann uploaded patch set 4 02/24/20, 14:35

  6. Claus Due commented on patch set 4 02/24/20, 14:36

    WidgetRegistry.php:76 Unresolved

    is_a() requires third parameter TRUE to allow comparing strings with strings.
  7. Daniel Siepmann updated the commit message in patch set 5 02/24/20, 14:36

  8. TYPO3com voted on patch set 4 V -1 02/24/20, 14:49 Completed build in 14m 01s on Mon, 24 Feb, 02:49 PM Test Summary: 48 of 72133 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-632

  9. TYPO3com voted on patch set 5 V -1 02/24/20, 14:56 Completed build in 15m 25s on Mon, 24 Feb, 02:56 PM Test Summary: 48 of 72133 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-633

  10. Susi Moog uploaded patch set 6 02/24/20, 15:44

  11. TYPO3com voted on patch set 6 V -1 02/24/20, 15:44 Completed build in 23s on Mon, 24 Feb, 03:44 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-634

  12. Susi Moog uploaded patch set 7 02/24/20, 15:48

  13. Markus Klein commented on patch set 7 02/24/20, 15:50

    I disagreee on the "signalling interface here". This is not about some "additional feature", this is about intrinsic security. It should be part of the WidgetInterface. This patch needs no additional rst, IMO. This is actually a security fix for a non-released version! => BUGFIX!
  14. Markus Klein voted on patch set 7 CR -1 02/24/20, 15:50

  15. Susi Moog commented on patch set 7 02/24/20, 16:02

    > Patch Set 7: > > I disagreee on the "signalling interface here". This is not about some "additional feature", this is about intrinsic security. It should be part of the WidgetInterface. > > This patch needs no additional rst, IMO. This is actually a security fix for a non-released version! => BUGFIX! How is that a security fix? At the moment the dashboard widgets need to be allowed for the user group anyway as far as I understood (so it's not as if the editors could "accidentally" see these widgets). So in this case, this is actually an additional configuration feature for people providing new widgets [as opposed to the integrator configuring user groups] not a new security feature. You can and should disallow widgets per user group configuration on the integrator side, too. I like the interface better than the extension of the widget interface scope - I'm in general in favor of composition via capability interfaces vs. bigger interfaces.
  16. TYPO3com voted on patch set 7 V +1 02/24/20, 16:11 Completed build in 20m 58s on Mon, 24 Feb, 04:11 PM Test Summary: 71647 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-636

  17. Markus Klein commented on patch set 7 CR 0 02/24/20, 16:29

    Okay, removing my -1. I stated my perception of the situation, feel free to continue as the majority says. Never the less I consider the rst superfluous, better extend the existing one. Less documents to read on upgrading.
  18. Markus Klein commented on patch set 7 02/24/20, 16:32

    > Patch Set 7: -Code-Review > > Okay, removing my -1. I stated my perception of the situation, feel free to continue as the majority says. > > Never the less I consider the rst superfluous, better extend the existing one. Less documents to read on upgrading. Forget my comment about the rst, I had something wrong open in my browser!
  19. Susi Moog commented on patch set 7 02/24/20, 16:39

    My main problem with this patch is currently that I'm not quite sure whether or not I like the mixing of two security concepts. We have group based security for widgets. With this feature we also have widget based security (at least in the sense of admin yes/no). However, I can still configure the availability of an admin only widget in the user group settings - which is kinda weird - I'd nearly say broken in the sense of it's not the predictable behaviour. If you want to have an admin only widget at the moment, you as an integrator may simply disallow that widget for all editor groups - or did I miss something?
  20. Susi Moog commented on patch set 7 CR -1 02/24/20, 17:08

    see previous comment - I'd rather not have both concepts mixed and don't see the need to rush things now.
  21. Richard Haeser commented on patch set 7 02/24/20, 17:08

    Yes, an integrator can now (with current master) decide for his own if a widget can be available for the usergroup. The reason why I started this was to prevent showing “admin” information accidentally. In the patch those widgets should indeed be excluded from the list of widgets to define access.
  22. Richard Haeser commented on patch set 7 02/24/20, 17:09

    I’m fine with both. It is clear people have different approaches and I can’t please them all ;-)
  23. Susi Moog commented on patch set 7 02/24/20, 17:13

    > Patch Set 7: > > Yes, an integrator can now (with current master) decide for his own if a widget can be available for the usergroup. The reason why I started this was to prevent showing “admin” information accidentally. In the patch those widgets should indeed be excluded from the list of widgets to define access. I understand your reasoning, but I'd go with Markus here and say security is not a feature. If we decide, we need this additional layer, let's do this after 10.3 after considering the implications this has (also in light of the work that has already been done regarding security in future versions).
  24. Susi Moog commented on patch set 7 02/28/20, 06:19

    @Richard: I'd propose to abandon this approach for now and have a dedicated discussion about how/what to additionally implement security wise - I actually think for now the user/group configuration is enough.
  25. Richard Haeser abandoned the change 03/25/20, 13:20

    We will close this feature for now. We accept the current situation to set permissions based on backend usergroups