Fixed public and troll access for community course group permissions.

The public/troll access wasn't being set for course groups because it only checked allow_troll_read etc if the community was not linked to a course.