i think a simple solution can be achieved by adding this component GitHub - discourse/discourse-groups-css-classes-in-body · GitHub and then doing some CSS magic, something like:
body.group-not-allowed-group.category-not-allowed-category #create-topic {
display: none;
}
where not-allowed-group is the group you want to hide the create topic button from and not-allowed-category is the category you want to target. you can do looping like this:
$categories: 'category1', 'category2', 'category3';
$groups: 'group1', 'group2', 'group3';
@each $category in $categories {
@each $group in $groups {
body.group-#{$group}.category-#{$category} #create-topic {
display: none;
}
}
}
of course if you go this route, probably easier to make a custom theme component with list type settings for group and category, so they are easy to select etc.