Showing User Groups under each block

Hello community,

I built a very complex website for my students with advanced permissions and I want to see for each block, which user groups have access to it (e.g. as text line under each block) when I am logged in as member of admin user group.
How can I achieve this?

My first idea was to override every view.php for the block types that I use, but the needed php is to complex for me. Can somebody help me?
Is there a easier way to achieve my goal?

Thanks in advance,
Mirko

A couple of ideas

  1. You could override or extend the Area class which loops through the blocks in an area and modify the code to check edit mode then show groups/permissions before each block.

  2. You could add JavaScript in edit mode to make an ajax callback to the server for each block, check permissions, and highlight appropriately.

Thank you for your ideas.
Two questions:
If there is an update to concrete core, will idea 1 be update-safe?

I’m new to concrete development and have developed 4 plugins for version 9 yet. But I have no clue how to use the php api classes for my described needs. Could you help me with some code? Especially how to get the group names that have permission to the block.

Thank you very much!

For 1, you would override rather than replace the core class. If the core were updated, your override would then extend the updated core class.

Thanks John, I tried to override the Area class through a file “application/src/Area/Area.php” and tried extending some methods (not sure, which will work for my purpose). Nothing worked, so I give up my approach now.
Hopefully someone can help me with some lines of code and an example for the extended class.