Issue #2859 optimization for bypass restricted role was added.