Security groups for custom modules

It doesn’t work by default, at least it never has for me. However, the one I’ve been working on is a 7.10 branch so maybe it works on the current branch. Here’s what I had to do to get security groups working for a custom module:

https://community.suitecrm.com/t/i-have-created-custom-module-through-module-builder-but-custom-module-s-security-group-sub-panel-not-display-and-when-i-check-in-relationship-the-relationship-already-there/84939/5