How to hide the assets section of the control panel to specific user groups?
Using a custom module it's easy to simply hide the Assets section of the CP.
Users would still be able to access the assets library by entering manually the URL but this is good enough for my use case.
Here's the (simplified) code:
&lt;?php

namespace modules\appModule;

use Craft;
use craft\events\RegisterCpNavItemsEvent;
use craft\web\twig\variables\Cp;
use yii\base\Module;

class AppModule extends Module
{
    public function init()
    {
        $user = Craft::$app-&gt;getUser();
        if (
            Craft::$app-&gt;getRequest()-&gt;isCpRequest
            &amp;&amp; !$user-&gt;isGuest
            &amp;&amp; $user-&gt;getIdentity()-&gt;isInGroup('editors')
        ) {
            Event::on(Cp::class, Cp::EVENT_REGISTER_CP_NAV_ITEMS, function(RegisterCpNavItemsEvent $event) {
                $event-&gt;navItems = array_filter($event-&gt;navItems, static fn ($item) =&gt; $item['url'] !== 'assets');
            });
        }
    }
}