ugly caching in security resolver