Make resolve_object correctly working when the permission must be checked on the original object (layer) and not on the resourcebase