Merge "Avoid string allocations when checking for permissions" into main