Joomla has better way to do this -- there are no fixed user groups in Joomla anymore and those might not exist.

    JFactory::getUser()->authorise('core.XXX');