Added support to check if the permission is for a user or for a group