Fix - SQLSTATE[42000]: Syntax error - If user has no permission.

Even if ids[] is empty set the group_id to null, otherwise it will select any groups.