I found something on a german page: https://www.plone-entwicklerhandbuch.de/erscheinungsbild/portlets-aendern-zuweisen-blockieren-und-entfernen
There it says you can use the portlet.xml to hide or add portlets - also in a specified context.
The very last code-snippet on the page for example will hide all portlets in the context "news". May be this can help? I would recommend to look at portlet.xml files to learn how the plone 5 notation is. The file in plone.app.event has some examples for assignment and portlet (also with context/interfaces).