fix #5216: merge grantedAuthority checks for existing grantedAuthority first and some other fixes for grantedAuthority handling in editor
fix #5216: merge grantedAuthority checks for existing grantedAuthority first and some other fixes for grantedAuthority handling in editor