core: fix permission check for scoped impersonation (#11603)
* fix: permission check for scoped impersonation
set global permission to have higher priority than the permission on a specific object
* add tests
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: walhallyus <walhallyus@gmail.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>