Zig Mandel's answer is correct as simple events like onEdit are unable to call methods that require authorization,however you were trying to get the user's group and that will be a problem since installable triggers run under the authority of the author of the script (in fact the person that set up the trigger which is usually the script author) which means not the user's group but yours...
So I'm afraid what you are trying to do won't be possible because in contradiction with the privacy rules in spreadsheet scripts.(read the doc that Zig refers to in his answer)
The only way to access the user's group information is using a direct function call in a menu or using a button that will ask for authorization., no automation in there ...