CS
Refactored permission checks to fix create access in non-primary group
Fixes/workarounds for PhpStorm error reports