Previously, the rule validation only checked the primary GID (cr_gid)
This caused issues when applying GID-based rules, as users with matching
secondary groups were not considered valid. This patch modifies both
functions to iterate through all groups in cr_groups to ensure all group
memberships are considered when validating GID-based rules.
For example, an user's primary group is staff (20) and is also in the
wheel (0) group, with this change, the rule gid=0:any works for enabling
them to run command as any user.