LPS-47464 Fix other places

Hi Ray,

this is fixing the cross-companyId permission checks.

I want to check with you I'm going the right direction.

1: In 1a8f16a I made groupId mandatory in AdvancedPermissionChecker, depending on a portal property (the backwards compatibility)
2 & 3: is just some scaffolding code
4: cf90608 Here I provide groupId based on entity's companyId or if there's no entity I use user's home companyId
5: cd7e548 - InlineSQLHelperImpl - I use company groupId when developer inserts "0" into groupIds or doesn't specify groupId at all (should never happen, but you know...)

This is a minimal fix that works.

If you think I'm on the right way, next things I'd like to do are:
1, extract all the common *PermissionChecker(Impl) code into one parent using generics
2, update portal code to use *PermissionCheckerUtil.check/contains with entity instance rather then entity ID, where possible

Thank you.